In the original Star Wars trilogy, Luke was said to be too old for Jedi training. Similarly the Jedi council says Anakin to be too old for training in the prequel trilogy and we do see kids getting training for becoming Jedi in the prequel too. But what is the right age to start Jedi training, was this ever established?
This is covered in the Star Wars factbook "The Jedi Path: A Manual for Students of the Force"
The responsible use of power takes a lifetime to perfect, and therefore the Jedi Order only rarely accepts members who are older than a few years. Most of you came to the Temple as infants.
It's notable that Ahsoka came to the Jedi temple at the age of three. This was considered to be slightly on the old side but not abnormally so.
It's not explicitly stated in the films, the implication is that training starts at a very young age, before children have a chance to get too attached to family members, and that training at a young age allows children to develop without (much) love, anger, hate, etc.
Also, in The Empire Strikes Back, Yoda said,
You must unlearn what you have learned.
With our increasing age, we learn automatically from environment (like we can't lift stones in air from a distance).