As sound travels through a water layer where the speed through which it travels varies with depth, the sound will tend to refract towards where it is the slowest.
A layer where temperature decreases as depth increases will refract sound downwards. A layer that has the inverse temperature properties will do the opposite. A layer that is isothermal (where the temperature remains constant as depth changes), will still tend to refract sound upwards because the increase in pressure also increases velocity, although not as strongly as temperature does, which is why temperature differences can easily overcome this effect where the water is not isothermal.
If you have a layer that refracts sound downwards on top of a layer that refracts sound upwards, you just created a sound channel, which acts as a wave guide in which sound will remain trapped and travel far longer distances horizontally before dissipating.
Ultimately you can’t really put a number on the required temperature differences because there are many other factors to take into account like how steeply the speed of sound changes, how tall the layer(s) are, what is the frequency of the sound, or how much of it you want to remain “trapped” in the sound channel.