In the times of the Beit Hamikdash, a person who survived a potentially life-threatening situation brought a Korban Todah, a Thanksgiving Offering, to express his gratitude to Hashem. Nowadays, when the Beit Hamikdash no longer stands and offerings cannot be brought on the altar, we substitute a public proclamation of gratitude to Hashem for an offering. A survivor from a life endangering situation as defined by the Gemara recites Birkat Hagomel in gratitude.
- Some say that Birkat HaGomel is non-obligatory and only optional, however, others argue that it's an absolute obligation. Nonetheless, all agree that given the opportunity, one should be careful to make this bracha properly. 
Who is obligated to make Birchat HaGomel?
- The four people who are obligated to make the Bracha are
- Someone who was freed from jail
- Someone who was sick and was healed
- Someone who traveled at sea
- Someone who traveled in the desert. 
- Some say that anyone who in near mortal danger such as someone saved from a wall collapsing, a loin attack, a goring ox, or a band of thieves at night, must make a Bracha. The ashkenazic minhag is like this opinion.  For specific situations see a posek. 
- For sickness that’s of potential mortal danger, Birkat HaGomel is required when healed. According to Ashkenazim, for sickness that’s non-mortal but confines a person to bed for 3 days or more requires a Brachat HaGomel when healed.  According to Sephardim, for any sickness which confines a person to bed for any amount of time requires Birkat HaGomel when healed. 
- A person who donated an organ does not say Birkat HaGomel with Hashem's name after healing from the surgery, however one may say it without Hashem's name. 
- Ashkenazim hold that no Bracha is made for traveling from city to city unless there’s a lot of wild animals or thieves. However, Sephardim hold that any travel from city to city obligates a Bracha if the trip was a Parsah (72 minutes). 
- Some say not to make Brachat HaGomel for traveling on an airplane since it’s considered safe, however many hold that HaGomel is required and such is the minhag. 
For being let out of jail
- The Minhag Ashkenaz is not to make Birkat HaGomel for being let out of jail nowadays because of the lack of danger involved in staying in jail.  Nonetheless the Sephardic minhag is to make it for being let out of jail even if there was no danger in staying in jail. 
When it should be said
- Preferably HaGomel should be said within 3 days. If it can’t be done within 3 days it should be said within 30 days, and if it can’t be said in 30 says it should be said whenever one wants. 
- It’s preferable to say Birkat HaGomel within 3 days even if it’s not said after Kriyat HaTorah in front of the Torah rather than waiting until later to say it after Kiryat HaTorah. 
Before a minyan
- The Bracha of HaGomel was established to be said before a minyan, preferably with two Talmediei Chachamim, and if there’s no minyan available one may not make HaGomel but rather should wait to find one. 
- The minhag is to say HaGomel after Kriyat HaTorah in front of the Torah. 
- The minhag is that women don’t make HaGomel however if a women who gave birth, happens to be in front of a minyan, she may say HaGomel. 
Listening to someone else say HaGomel
- Someone who listens to someone else make HaGomel has fulfilled the obligation if one heard the entire Bracha. However, if the one making the Hagomel wasn’t obligated in the Bracha, someone who’s listening doesn’t fulfill the obligation unless one answers Amen. 
- Some are in doubt whether someone can fulfill the obligation of the person listening if the listener and the one making the Bracha have different reasons for obligation of the HaGomel. Rather, only someone who is obligated in HaGomel for the same reason should fulfill someone else’s obligation.  However, some argue that anyone who’s obligated in HaGomel can fulfill the obligation of someone else. 
- Vayikra 7:12
- The source of Birkat HaGomel is the Gemara Brachot 54b which states that one who has completed a sea voyage, traveled through the desert, has been sick and healed, or was imprisoned and freed should thank Hashem in the form of Birkat HaGomel. According to the Magen Avraham (OC 219:1), Birkat Hagomel, like the Korban Todah, is non obligatory but rather optional. The Peri Megadim (OC 219:1) argues that it is obligatory. Nevertheless, all poskim (Chasam Sofer O.C. 51, Minchas Yitzchok 4:11-9) urge one to be careful to fulfill this mitzvah given the opportunity.
- S”A 219:1
- S”A 219:9, Mishna Brurah 219:32
- See also Piskei Teshuvot 218, Halichot Shlomo 23:1
- S"A 219:8 Mishna Brurah 219:28
- Taz 219:5, Yalkut Yosef (Brachot pg 583 and 758)
- Sh"t Tzitz Eliezer 10:23
- S”A 219:7, Yalkut Yosef 219:17
- Vezot HaBracha pg 158 quotes Rav Shlomo Zalman and Rav Moshe Feinstein as requiring a Bracha, and Minchat Yitzchak (2:47) as arguing. Sh"t Igrot Moshe 2:59, Sh"t Yechave Daat 2:26, and Halichot Shlomo (Tefillah 23:5) hold that one should make Birkat Hagomel for traveling in an airplane. http://www.dailyhalacha.com/displayRead.asp?readID=2132 specifies that for Sephardim one must travel 72 minutes in order to make a Birkat Hagomel.
- Biur Halacha 219 D"H Chavush
- Kaf HaChaim 219:11, Piskei Teshuvot 219:6
- S”A 219:6, Mishna Brurah 219:20. See Piskei Teshuvot 219:4 who writes there’s a minhag who are lenient to wait until Shabbat to say HaGomel at the Torah.
- Magan Avraham 219:6, Mishna Brurah 219:20
- S”A 219:3, Buir Halacha D”H VeYesh Omerim, Shoneh Halachot 219:2, Piskei Teshuvot 219:15
- Mishna Brurah 219:2
- Mishna Brurah 219:3, Halichot Shlomo 23:4, Vezot HaBracha (pg 158)
- S”A 219:4,5
- Hagot Rabbi Akiva Eiger 219:5 leaves this question in doubt. Therefore this situation should be avoided (see Piskei Teshuvot 219 note 90).
- Yalkut Yosef (Otzer Dinim LeIsha pg 162-4)