Wa `alaykum as-salamu wa rahmatullahi wa barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Islam encourages mothers to breastfeed their babies for long periods (up to 2 years). It is advisable for mothers to consult family doctors regarding the breastfeeding periods that maintain their and their babies’ health.
Answering your question, Dr. Wael Shehab, PhD in Islamic Studies from Al-Azhar University and currently the Imam of the Downtown Toronto Masjid in Canada, states:
Islam encourages mothers to breastfeed their babies for prolonged periods (up to two years). The Qur’an says,
“The mothers (including those divorced) shall nurse their children for two whole years, if they wish to complete the period of nursing. The father shall bear the cost of their feeding and clothing on equitable terms. No soul has a burden laid on it greater than it can bear. No mother shall suffer because of her child. Similarly the father should not suffer. The same duties rest upon the heir (that is, if the father dies). If they (that is, the parents) both decide on weaning (the child) by mutual consent and after due consultation they are not to blame. Also they are not to blame if they decide on a foster mother, provided they insure, in a fair manner the safety of the child.” (Al-Baqarah 2: 233)
From the above Qur’anic verse, it becomes clear that mothers are encouraged to breastfeed their babies for complete two years as long as it is beneficial for the child.
The actual period of breastfeeding is better specified by a professional doctor who is following up the baby’s health and body development. Islam encourages resort to professionals in all fields; so doctors are to be consulted in this regard.
Allah Almighty knows best.