There are a few different reasons why the water in the ocean doesn’t freeze all over, like certain lakes and ponds. (Which sometimes freeze enough that you can go ice-skating on them!)
One reason ocean water doesn’t freeze all the way through is because it’s so salty! Salt lowers the freezing point of water, meaning that freshwater (without salt) will freeze sooner than salt-water; salt-water like the ocean has to get even colder than freshwater before it will freeze, and it doesn’t always necessarily reach that cold enough temperature.
In addition to all of its salt, ocean water also undergoes more movement than the freshwater in lakes and ponds. The movement of ocean water (like from currents or wind) helps it retain more heat than smaller lakes and ponds where the water is generally much more still.
In certain cold parts of the ocean, some water will freeze on top and then float like big sheets on the water below it! The amount of frozen water in the ocean depends on the season, but generally at least 15% of ocean water is frozen at any given time. – That’s several million square miles!