Sure Al-Baqara

2:233

۞ وَٱلْوَٰلِدَٰتُ يُرْضِعْنَ أَوْلَٰدَهُنَّ حَوْلَيْنِ كَامِلَيْنِ ۖ لِمَنْ أَرَادَ أَن يُتِمَّ ٱلرَّضَاعَةَ ۚ وَعَلَى ٱلْمَوْلُودِ لَهُۥ رِزْقُهُنَّ وَكِسْوَتُهُنَّ بِٱلْمَعْرُوفِ ۚ لَا تُكَلَّفُ نَفْسٌ إِلَّا وُسْعَهَا ۚ لَا تُضَآرَّ وَٰلِدَةٌۢ بِوَلَدِهَا وَلَا مَوْلُودٌۭ لَّهُۥ بِوَلَدِهِۦ ۚ وَعَلَى ٱلْوَارِثِ مِثْلُ ذَٰلِكَ ۗ فَإِنْ أَرَادَا فِصَالًا عَن تَرَاضٍۢ مِّنْهُمَا وَتَشَاوُرٍۢ فَلَا جُنَاحَ عَلَيْهِمَا ۗ وَإِنْ أَرَدتُّمْ أَن تَسْتَرْضِعُوٓا۟ أَوْلَٰدَكُمْ فَلَا جُنَاحَ عَلَيْكُمْ إِذَا سَلَّمْتُم مَّآ ءَاتَيْتُم بِٱلْمَعْرُوفِ ۗ وَٱتَّقُوا۟ ٱللَّهَ وَٱعْلَمُوٓا۟ أَنَّ ٱللَّهَ بِمَا تَعْمَلُونَ بَصِيرٌۭ

Und die Mütter stillen ihre Kinder zwei volle Jahre. (Das gilt) für jemanden, der das Stillen zu Ende führen will. Und demjenigen, dem das Kind geboren wurde, obliegt es, für ihre Versorgung und Kleidung in rechtlicher Weise aufzukommen. Keiner Seele wird mehr auferlegt, als sie zu leisten vermag. Keine Mutter soll wegen ihres Kindes zu Schaden kommen, noch einer, dem das Kind geboren wurde, wegen seines Kindes. Und dem Erben obliegt das gleiche. Wenn sie beide jedoch in gegenseitigem Einvernehmen und gemeinsamer Beratung (das Kind vorzeitig) entwöhnen wollen, so ist darin keine Sünde für sie (beide). Und wenn ihr eure Kinder (von einer Amme) stillen lassen wollt, so ist darin keine Sünde für euch, sofern ihr das, was ihr geben wollt, in rechtlicher Weise aushändigt. Und fürchtet Allah und wißt, daß Allah das, was ihr tut, wohl sieht!

Tafsir 2:233

Mothers who intend to complete the period of breastfeeding should nurse their children for two full years. The husband and father of a child is responsible for the maintenance and clothing of a divorced mother who breast feeds her child in accordance with the customs of society that do not go against the sacred law. No person is burdened beyond what he is able to do. No parent is allowed to use the child as a means to harm the other. The heir (who would inherit from the child if the child were to pass away leaving behind wealth) shall be responsible, if the father dies without leaving any wealth, for the same obligations as that of the father. If the parents decide to wean the child before two years finish, then there is no sin on them, if this is done after full consultation and agreement that it is in the child’s best interests. If you wish to hire wet-nurses for your children instead of their mothers, there is no sin in doing so provided you pay the agreed wages of such wet-nurses without any shortfall or delay. Be mindful of Allah by fulfilling His instructions and avoiding His prohibitions, and know that Allah sees everything you do and nothing is hidden from Him. He will reward you for any action you do.