The Shulhan Aruch (Orah Haim 219:1) says that there are four situations which warrant reciting Birkat Hagomel, which is based on Tehillim 107. The four situations are summarized in the word “Haim”: Havush-someone who was previously imprisoned; Yisurim-someone who was ill; Yorde Hayam-seafarers; and Midbar-someone who crossed the desert.
Regarding seafarers, there is a debate as to whether the blessing applies to those who travel in a river. This debate is influenced by the Sephardic and Ashkenazic approaches to travelling in general: the Sephardic custom is that Hagomel is recited whenever one travels beyond one’s city, whereas the Ashkenazic custom is not so. Accordingly, the Sephardic opinion would agree that one should recite Hagomel after travelling by boat in a river, whereas the Ashkenazic opinion would be that it is not recited. Nevertheless, Rabbi Betzalel Stern (Betzel Hahochma, vol. VI, § 115) and Rabbi Ben Zion Abba Shaul (Or Lezion, 14:43) rule that as long as the shore cannot be seen during the boat ride and one is travelling for 72 minutes, one may recite Birkat Hagomel. If the shore can be seen and one travels for less than this amount of time, then one would not recite the blessing.
Summary: If one travels by boat for longer than 72 minutes and does not see the shore at some point during the trip, one should recite Birkat Hagomel.