When is the right time -- the first torah service that you're able to physically attend, or is there some stricter standard?
What do you do that day in shul?
Is the answer different for a woman or a minor? (Are they obligated to gomel? If not obligated, permitted?)
One should attend synagogue as soon as one can (preferably within 3 days).
One should try to get an Aliya to the Torah. (This is considered a chiuv).
As for women 'bentsching gomel', Dose of Halacha writes:
..The minhag is to recite it within 3 days of the incident after krias hatorah, though it may be recited later if necessary (Shulchan Aruch OC 219:6; Mishna Berura 20).
The Chayei Adam (after 69) wrote a prayer after surviving an explosion. He writes that one should say this, along with the pesukim of the korban toda and give charity equal to the value of the animal he would have brought in Temple times. (See Mishna Berura 218:31).
While women would also bring korbanei todah, the custom developed among many Ashkenazi communities that women don’t say the beracha, as the public recital is deemed immodest. The Magen Avraham (OC 219:4) writes that her husband should recite it on her behalf, while the Mishna Berura says that she recites it in front of ten women and a man. The Aruch Hashulchan (OC 219:6) suggests that this custom may have developed because women weren’t always present for Leining. Nonetheless, the Baer Hetev (219:1), Chayei Adam (65:6), Yechave Daas (4:15) and others all allow a woman to say it loudly from her side of the mechitza. Thus, Sefardi women should only say it in the presence of a minyan.
In what is likely the last teshuva R’ Moshe Feinstein ever wrote (OC 5:14), he paskens that a new mother should recite the beracha in front of another, ideally her husband, and there is no need for a minyan.
In England, we generally follow the Minchas Yitzchak (4:11). Women go to Shul and respond to their husband’s borchu and beracha (when he’s called up), with intent to thank Hashem.