Praise be to Allah.
The maximum length for nifaas (post-partum bleeding) according to the majority of scholars (may Allah have mercy on them) is forty days. Anything more than forty days is not regarded as nifaas; rather it is irregular bleeding that does not prevent a woman from praying, fasting and having intercourse, unless that happens at the time when she would ordinarily menstruate, in which case she is not allowed to pray, fast or have intercourse because of the menses, not because of the nifaas.
Ibn Qudaamah (may Allah have mercy on him) said in al-Mughni (1/210): If the bleeding of nifaas lasts for more than forty days, and coincides with the usual time of the monthly period, then it is menses; if it does not coincide with that time, then it is istihaadah (irregular bleeding). Ahmad said: If the bleeding continues, then if it is during the days of her usual menses, she should refrain from praying and her husband should not have intercourse with her. Otherwise, she is like one who experiences istihaadah (irregular bleeding); her husband may have intercourse with her, and she should do wudoo’ for every prayer, and she should fast and pray if Ramadan comes, and she should not break the fast and make it up later. End quote.
It says in Fataawa al-Lajnah ad-Daa’imah (vol 2, 4/221): With regard to nifaas (postpartum bleeding) when forty days have ended, she comes under the ruling of women who are in a state of purity, and she must do ghusl and start praying and fasting, and she is permissible for her husband. Whatever she sees of blood after forty days is to be regarded as irregular bleeding that does not come under the rulings on menses or nifaas, unless that coincides with the time of her period, in which case she should refrain from praying and fasting for the usual days of her period. If the woman in nifaas sees the tuhr (sign of purity, white discharge signalling the end of bleeding) before forty days, then she should do ghusl, and pray and fast, and she is permissible for her husband. Then if the bleeding resumes before the end of forty days, she should stop praying and fasting until she becomes pure and completes the forty days. End quote.
In the answer to questions no. 10488 and 128877 we stated that this is the view of the majority of scholars.
Based on that, if a man divorces his wife after the end of forty days, then the basic principle is that it is a talaaq and counts as such, unless that talaaq coincided with the time of her period, in which case it is a divorce issued at the time of menstruation, and there is a difference of scholarly opinion as to whether a divorce issued to a woman who is menstruating – and also one who is bleeding following childbirth during the nifaas period – counts as such. Previously on our website we have favoured the view that a divorce issued to a menstruating woman does not count as such, as explained in the answer to question no. 72417
And Allah knows best.