I'll gladly take answers from any timeframe or general location as I'm curious how long kids were fed breast milk and what they eventually moved on to. As a parent to a toddler, the recommendations are formula/breast milk until about 6 months then expanding diet but surely before modern times, kids stayed on milk longer?
Oh! I know this one! My son is 6.5 months old and I've been doing a bunch of research into this topic lately because I was curious how much the American habits and CDC/WHO recommendations differ from ancient behaviors.
So, to preface with information you might already know but will hopefully provide context for other readers, the WHO currently recommends exclusively breastfeeding if possible, formula if not, until 6 months. Then you're supposed to introduce complementary foods slowly until the age of 2. Biologically speaking, human babies don't produce enough iron after 6 months, so at a minimum, iron-rich foods become necessary.
The big change isn't when solid foods are introduced but how fast babies are weaned from the breast and there's actually evidence that one of the big changes that happened due to the agricultural revolution (vs. pastoral lifestyles) is that children were weaned earlier thanks to the availability of things like animal milk and grain. There's a journal called "Childhood in the Past" that addresses this precise question and basically says:
Analyses of child skeletons from this period suggest that supplementary foods were given to babies at around 6 months and weaning was complete by 2 to 3 years of age.
[The source of this quote also goes into detail about ancient baby bottles that you may find interesting.]
A friend of mine spent some time on the Mongolian steppes a couple of years ago traveling with a nomadic family there, and she reported that infants there were introduced to "solid" foods at around 6 months.
TLDR; it's not really a "modern vs. ancient" so much as a "hunter/gatherer vs. pastoral vs. agricultural lifestyle" difference. Humans with urban centers have been weaning kids quickly since the dawn of history, nomadic humans generally don't.
While a great deal of research and work is still required, the data available highlights trends that seem to indicate that shorter breastfeeding times were practiced in societies characterised by urban developments. [Source]