Until how long after a birth may a woman bentch ha-gommel? What is the source for this?
A woman should only make birkas ha-gomel from after 7 days after giving birth.
She should make the berachah as soon as possible, and the best is within three days. If this is not done, she can make the berachah later, and there is no time limit.
Shulchan Aruch 219:6, as based on the Tur; the reason is that the berachah corresponds to the Torah offering, and there is no time limit for this offering.
This is also the ruling given by the Chayei Adah 65:6.
The lechatchilah time of three days is mentioned by the Orchos Chaim, based on the Ramban, though some understand that this refers specifically to somebody who is returning from a journey overseas.
Note that in Likkutei Dinim the maximum time is given as thirty days; see Ritva, Berachos 54, citing from Ra’ah.
The berachah should not be made less than 7 days after giving birth, because a woman is only considered to have made the initial recovery from giving birth after seven days, and ha-gomel should not be made before this time (see Ateres Zekeinim 219).