One of the dangerous situations requiring the recitation of Birkat Ha’gomel is a sea voyage. A person who traveled by sea must recite Birkat Ha’gomel after reaching dry land, to express gratitude to G-d for bringing him safely through the ocean.
Hacham Ovadia Yosef ruled that this applies also to somebody who swims in the ocean – or even in a lake, like the Kinneret – if he swims in deep water, where he cannot stand. This, too, is considered dangerous, and so after one swims in the deep water in an ocean or lake, he must recite Birkat Ha’gomel. It is reported (in Ma’ayan Omer) that Hacham Ovadia did not specify any amount of time that one must spend in the deep water for Birkat Ha’gomel to be required. As opposed to the requirement of Tefilat Ha’derech (the wayfarer’s prayer), which one recites only if he is traveling a certain distance, the obligation of Birkat Ha’gomel is a function of emerging from a situation of danger, and spending any amount of time in deep water in the ocean can be dangerous. Therefore, even if one swam very briefly in an ocean or lake, he must recite Birkat Ha’gomel afterward.
Although others – including Hacham David Yosef (contemporary), in Halacha Berura, and Rabbi Moshe Ha’levi (Israel, 1961-2000), in Birkat Hashem – disagree, we follow Hacham Ovadia’s ruling, as discussed in Yalkut Yosef (English edition, p. 397).
Summary: Just as one who travels by sea must recite Birkat Ha’gomel upon reaching dry land, likewise, one who swims in deep water in an ocean or lake, in a place where he cannot stand, must recite Birkat Ha’gomel afterward, even if he spent only a very brief amount of time in the deep water.