Functionally, it seems like about the best time would be mid to late twenties. Time enough for strong general education and some broad water-testing* (so to speak) and for brain development to finish so that likelihood of being grounded enough to rationally and effectively choose a career specialization is much higher.
I'd kinda' question if pre-career specialization is a good idea at all, though, especially if you're in a tumultuous economic region. Broad-base and effective general education and a wide base of previous experience in disparate fields would seem to be the best idea t'me, probably with an emphasis on re-training and learning on the job. Heavy and early specialization seems to just leave quite a few people sitting around with a great deal of training and nothing to use it on, or incredibly miserable when they find out five or ten years into a career they hate what they're doing and don't have the means to change venues...
*This part in particular seriously doesn't get enough support in basically any society, though, at least from what I've seen and heard. Very few people actually have any bloody idea what they're getting in to, and it's damned rare there is, and double-damned difficult to get, a chance to actually get that exposure outside of maybe one or two fields (usually the parents or relatives, who are pretty likely to be in similar fields). And the individual that doesn't like those few fields are often just kinda' buggered insofar as preparation goes.