Quick answer
When can I pray after childbirth?
You resume prayer when nifās ends and you have performed ghusl. If bleeding continues, the applicable maximum and treatment of interruptions depend on the madhhab being followed.
Prayer resumes when your nifās has ended under the applicable madhhab rules and you have performed ghusl. A sign of purity may establish its end before the school’s maximum; if bleeding continues, maximum-duration rules differ by school.
If bleeding stops and you observe a sign of purity — even at day 10 or day 20 — your nifās has ended. You perform ghusl and resume praying immediately; there is no obligation to wait the full 40 days.
A brief pause in bleeding is not by itself the end of nifās in the view of most scholars unless it is accompanied by a sign of purity. If you are unsure whether bleeding has truly stopped, the cautious practice in the Hanafi and Hanbali schools is to treat intermittent bleeding within the 40 days as continued nifās.
Do not apply a universal day-41 transition: well-known school positions include different maximums and different treatment of returning bleeding. Noor should state a result only within the selected rule context it supports.
This summary draws on the established positions of the four Sunni madhhabs. For your specific situation, consult a qualified scholar.
Go deeper
Postpartum bleeding (nifās) in Islam