Longer cranks tend to cause a sharp bend in the knees at top dead center, right when power begins to be applied. Cranks that are too short won't be as efficient, as sticking to higher cadences involve the leg mass moving around more than with a shorter crank.
For general road racing and touring, those with road frames smaller than 21" (54 cm), or people less than 5'9", will want a 170 mm crank. Frames from 21.5" to 24" (55 to 61 cm), people from 5'9" to 6'1", will probably want cranks from 170 to 172.5 mm. Those with frames over 24.5", typically over 6'2", tend to want cranks of 172.5 to 175 mm. Be sure to read our article about your optimal frame size.
The story isn't over, of course. If you are a track races, reduce this estimate by 2.5 mm, more if the races are short or the track is steep. If you have frequent knee problems, shorten the cranks by 2.5 to 5 mm, and adjust your gear choices downwards to reduce the stresses your knees have to endure from mashing a crank with more resistance.
If you're calculating this to use an a mountain bike, use cranks 2.5 to 5 mm longer than on a comparable road bike. If you ride time trials or hilly races, add 2.5 mm to your crank. For pure hill climbs, add 5 mm.