A cooler that has ice and water in it will be held at 32 degrees Fahrenheit until all the ice is melted. The rate at which the ice melts depends on the rate at which heat can enter the container.
The rate at which heat crosses any thermal boundary can be modeled as:
$$\dot Q=\frac{\Delta T}{\sum 1/h_i}$$
Where $h_i$ represent the thermal conductivity of each thermal resistance. In the case of the cooler there will be a thermal resistance due to the cooler. A thermal resistance due to the transition from liquid inside the cooler to the cooler wall, and finally an transition between the cooler outside and the outside medium.
This outside thermal resistance changes depending of whether the medium is air or water. A typical value for still air is around $5 \frac{W}{m^2K}$, while a typical value for water is $100\frac{W}{m^2 K}$.
Now if we assume the cooler can be approximated as 4cm thick Styrofoam then it would have a h of $0.8 \frac{W}{m^2 K}$. So the thermal resistances of the cooler in the two scenarios are:
$$\frac1{100}+\frac1{0.8}+\frac1{5}=0.01+1.25+0.2=1.45$$
$$\frac1{100}+\frac1{0.8}+\frac1{100}=0.01+1.25+0.01=1.26$$
So the air version would insulate 1.15 times better.
The temperature differences however would drive the heat with $\frac{75-32}{52-32}=2.15$ times the temperature difference. So on a warm summer day the sea would keep your cooler contents cool 1.9 times longer.
Note that a 4cm thick Styrofoam cooler is actually quite a nice cooler. If you don't have such a nice cooler, it might be better to keep the cooler out of the water, but if you don't have a nice cooler, the ice is gonna melt pretty fast no matter where you put it.