There is no fixed age at which mothers are recommended to stop breastfeeding, or which is considered better from a medical perspective than any other age. As long as baby is full and gets the necessary nutrients, and as long as mother and baby are comfortable nursing, you can stop breastfeeding at many different points.
A baby can survive on only breastmilk, vitamin D and any necessary medication up until six months. When baby is between four and six months, it is appropriate to introduce food by giving baby small tastes. How soon baby wants to eat more regular food varies.
Many women continue to breastfeed while also giving baby tastes, and nurse in the morning and evening. Other women decrease the number of breastfeeding sessions as they introduce food, porridge and/or formula. This varies and, as long as baby is full and gets the necessary nutrients, there are many alternatives that are equally correct.
It’s a good idea to give yourself time to stop breastfeeding. Many women decide to stop during vacation or while on parental leave.
However, there are more appropriate and less appropriate periods during which to wean your baby. While it might not always be up to you to decide, avoid certain situations if possible. It is neither the most suitable nor easiest time to wean a child who is starting preschool, getting a new sibling, if you are going to start working, or in connection with a move or any other major change. Choose a time when your baby is healthy and does not have a fever (when baby normally has a greater need for closeness and wants to nurse more frequently).
But again, as the parent, it is up to you to find your own path and make the choices that are best for your baby and that work best for your family.