Concerning menstruation and childbirth bleeding, Allah says in the Qur’an, “Do not approach them until they become pure. When they are pure, go to them in the manner that Allah has prescribed for you.” The Messenger of Allah, upon whom be peace, said to Fatimah bint Abu Habish, “Do not pray during your period. After it has ended, perform ghusl and pray.” (Related by al-Bukhari and Muslim.)
Post-childbirth bleeding is treated in a similar manner, according to the consensus of the companions. If a woman gives birth and has no flow of blood afterwards, some scholars say that she must perform ghusl, while others say that it would not be necessary. There is no textual authority on this latter point.