If the postpartum woman becomes definitely pure before forty days, she must perform the ritual bath and perform acts of worship as a pure woman does. What was prohibited for her also becomes permissible, so she becomes permissible for her husband after her bath. The minimum duration for postpartum bleeding is a moment (an instant), and its usual maximum is forty days. Reaching forty days is not a condition; rather, it is sufficient for the blood to stop or to see the white discharge (qassa bayda'). And Allah the Almighty knows best.