Riding a horse is the end result of training a horse. Start training from the time they are born and by the time they are ready to carry the weight of rider and gear life is good.
There are lots of forms of riding--work, pleasure, every day, once a week, performance-so there is no absolute answer.
You can start preparing them for their journey from the beginning.
I've seen 2 year olds fit as a 6 year old and actively working. I've seen 10 year olds that I wouldn't ride until they were in the proper shape to carry the load.