On one of my many trainer rides, I figured I would study how the pros sprinted (as this is the only thing I can do decently on the bike). I watched various Tour finishes from a while back, I think the Tour where Fabio Baldato won the Champs stage. What surprised me was how few pedal strokes the winners went - usually 8 or so - in the wind. This means they were sheltered until then. The exception was the last stage where the winner went 21 revs. This puzzled me until I realized it was a slight downhill sprint - so top speed beats the jump.
A long time ago I read a rider can do 40 revs at max effort before blowing up. Since I can't do 40 (I blow up earlier) I used to count pedal revolutions backwards from the line - 20 to 30. So depending how far back I was in the field, I'd sprint early (30 revs) or late (20 or fewer).
One race I did well I experimented with the very short pro sprint - 10 revs in my case. I did well (3rd or 4th) but I felt like if I'd gone earlier, I'd have been in contention for the win. I prefer a 20 revolution sprint.
I cut the sprint time almost in half for headwinds (so 10 or so). And stretch it to 30 or more revs in tailwinds.
So the actual sprint lasts anywhere from 8 to perhaps 30 revolutions. If you're a good tactician and have decent threshold strength (or you have a really good leadout rider), you can safely hold a 3rd-6th position going into the final 300 meters - and at that point you can probably choose your jump point and therefore your sprint distance.
Figure out what gear to use and the corresponding distance to the line and you have your ideal sprint start point.
For getting into position - if you're skilled at slicing through the field (not just moving up on the outside) you might be able to wait till a mile or two to go (or even less - but keep in mind you will be using sprint reserves to move up in the last half mile). In very intense sprints it might be better to move up 5 or 6 miles before the sprint. In crits I figure I should be closer to the front at 2 to go. The crits I do are usually not totally strung out so moving up is reasonably easy.
Finally, remember you can shift while you're sprinting - this is especially important if you're jumping from a lower speed. I usually shift once when I jump then once as I start winding up speed. Practice this on your own before you do it in close quarters.
hope this helps and good luck at the next sprint,
cdr