Praise be to Allah.
40-Day Rule after Birth in Islam
Forty days is the longest period that the woman in nifas can refrain from praying and fasting , so long as blood is still flowing. After that, she should do ghusl and pray, and consider herself to be in a state of istihadah (irregular vaginal bleeding which is neither menstruation nor nifas) if the bleeding does not stop.
Umm Salamah (may Allah be pleased with her) said: “At the time of the Messenger of Allah (peace and blessings of Allah be upon him), the woman in nifas would sit (i.e., refrain from praying and fasting) for forty days…” (Narrated by al-Tirmidhi).
Can women go out during the nifas period?
With regard to the belief that a woman has to stay in her house for forty days after giving birth and not go out, this is a mistaken belief and women do not have to do this. It is permissible for them to go out during these forty days to any place she wants, so long as she fulfills the shar’i conditions (i.e., hijab etc.)
And Allah knows best.