Breast feeding is recommentded up to 2 years.
Breast milk is the natural first food for babies, it provides all the energy and nutrients that the infant needs for the first months of life, and it continues to provide up to half or more of a child's nutritional needs during the second half of the first year, and up to one-third during the second year of life.
World Health Organization, Breastfeeding, 2018.
As the baby grows heavier, the mother's milk becomes insufficient. At year 2 the mother can only provide one third what the baby needs of nutrients, so then it is better to provide other foods.
[Quran 2.233] Mothers may nurse their infants for two whole years, for those who desire to complete the nursing-period...
Breastfeeding is limited to two years in the Quran.
How could an illiterate man who lived 1400 years ago have determined how long to breastfeed?
Another less known benefit of breastfeeding is the bond between the mother and the baby.
The secret to mother-baby bonding might be breast milk, according to new research that determines that breast-feeding mothers are more likely than formula-feeding moms to bond with their infants in the months after they’re born. They also demonstrate stronger brain responses when they hear their baby cry, according to a study published in the May issue of the Journal of Child Psychology and Psychiatry...
While participants lay in a scanner and listened to clips of their own baby and an unknown child crying, researchers tracked what areas of their brains lit up. All mothers’ brains were more active when listening to their own baby’s cry, but the changes in the breast-feeding mothers’ relevant brain regions were far more significant.
Time, Is Breast Milk the Key to Mother-Baby Bonding?, 2011
Breastfeeding is key to mother-baby bonding; a very powerful social bond. This was known recently, however this was portrayed in the Quran 1400 years before it was discovered. On the final Hour this very powerful social bond breaks.
[Quran 22:2] When you will see it [final Hour] every nursing mother will discard her infant, and every pregnant woman will miscarry, and you will see the people drunk, even though they are not drunk. but the punishment of Allah is severe.
On the final Hour this social bond breaks.
How could an illiterate man who lived 1400 years ago have known that breastfeeding bonds the mother with the baby?