Nifas is the bleeding a woman experiences following childbirth, and like menstruation it exempts her from prayer and fasting while it continues; scholars generally analogize its rulings to hayd, since the Sunnah addresses the broader category of menstrual-type bleeding (compare Quran 2:222). No verse fixes an exact length; the timeframe comes from juristic reasoning and the practice of women in the Prophet's ﷺ time. Most scholars — Hanafi, Hanbali, and the standard Shafi'i position — hold that nifas has a maximum of 40 days, since women were commonly told to wait roughly that long before resuming prayer. If bleeding stops earlier, even after just a few days, a woman performs ghusl immediately and resumes prayer and fasting right away — there is no minimum duration required. If bleeding continues beyond 40 days, most scholars treat any further discharge as istihadah rather than nifas, meaning she should begin performing ghusl and praying again despite ongoing spotting. Some Shafi'i scholars allow up to 60 days as an outer maximum in unusual, medically documented cases.
Q&A · Purification
How long does nifas (postpartum bleeding) typically last, and when should a woman perform ghusl afterward?
References
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.