Length of nails is important, but so is the ability to play well within a "length range". The more experience you get with controlling tone variability and timbre, the easier it is to produce whatever tone you wish with "long" or "short" nails. So there really is no perfect length. There is obviously too long or too short, but there's a good bit of leeway in between. And you simply adjust as the nail grows out.
Here's a short example of tone uniformity and variability that can be achieved with "long" or "short" nails. (Just not too long or too short)
First sample is a tremolo, in which uniformity of tone is so important. Has everything to do with proper nail length, and even more importantly, shape. If you don't have uniformity of tone with a tremolo, you'll get that gallop. Second little part shows variability on tone with the thumb, and third little part is a demonstration of variability of tone with i,m,a. You want to be able to get a nice warm "dolce" as well as a crisp, brilliant "ponticello" all with the same nails.