Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: “A mother in Islam is expected to provide nurturing care and love for her children. Breastfeeding is undoubtedly one of the best ways of providing such care. Breast milk has been specifically created by Allah to provide all the necessary nutrients and immunity so vital for the development of the child in its formative years, and as such there is no substitute for it. So you are to be commended for your zeal to provide the loving care for your child.
It is, therefore, not at all surprising when Allah states in the Qur’an, “Mothers shall give such to their children for two whole years, for those who wish the suckling to be completed…if after consultation, they choose by mutual agreement to wean the child, it is no offence for them…” (Al-Baqarah: 233).
Scholars have deduced a number of points from the above verse: the full term of breastfeeding is two years—if the parents so decide; however, should they prefer to wean earlier, it can be done without incurring any offence or sin so long as such a decision has been made after giving due consideration to the welfare of the child as well as the interests of both parents.
as for the question whether a mother can breastfeed past the two years, the answer is: there is nothing in the sources to indicate that it is wrong to do so. So, you are free to do so if you deem it conducive to the wellbeing of your child.
Having said this, however, I should convince you that at some point you must make a distinction between providing, responsible nurturing care and spoiling a child. Sometimes a child may never wish to wean at all if you were to leave it entirely to his choice. It is therefore important for you to plan to wean him gradually without causing him undue emotional stress. You should decide your move in consultation with your paediatrician and a trained nurse.”