I’ll start the answer to this with a caveat. There is no correct taper in length or style of training.
The ideal duration depends upon your race – shorter races usually require a shorter taper and vice versa for longer races. Generally my rule of thumb is 5-7 days for sprint/standard, 10-14 days for 70.3, and 14-21 days for Ironman. The more fatigued you are starting the taper, the longer you will need.
While there isn’t much agreement on the ideal length, one thing coaches and scientists are agreed on is that volume must be reduced and that the athlete should maintain some intensity – enough to retain the top end but not so much that more fatigue is created. E.g. if you have been doing some threshold sessions , say 4 x 8 mins at functional threshold on the bike then maybe 2-3 x 4mins will be enough. Maintaining frequency of training is also encouraged. If you are used to 2 sessions per day then continue but keep them short.
Another statement you hear often is that it’s better to come into a race feeling slightly underdone than overcooked. With this in mind, aim for slightly less than you think feels right and get to the start line feeling like a caged tiger!