This may be a redundant question but I was not sure how to google or search the answer (when I did I did not get proper results). On a whole note trill on the piano, how many times do I go back and forth from note to note? I read that it was sixteen. But for example in Chopin's Nocturne in C Sharp Minor, the first trill can be heard going back and forth (for lack of a better word) about 21-23 times. Also, does the time signature effect how many time you will alternate? The piece is in common time
Trills can vary in their speed.
They may also be played in or out of the time of the piece, depending on the performer's skill level and intent. In some cases the performer may start the trill slowly, then speed up the trill. In other cases the performer may want the trill to maintain a strict tempo match. There are also some stylistic choices to trilling depending on style and time period of the piece.
Trill speed range can be practiced until the musician has a range of expression available. A well played slower trill will usually sound better than a badly played fast trill.