Water has a higher specific heat than air or land. Specific heat is the amount of energy required to change the temperature of something; water requires more energy for its temperature to change than air or land require. Think about going swimming on a hot day. The water might still be cool, even though the air and land are warm.
Because water has a higher specific heat, it has a higher heat capacity. That just means that it takes a lot of energy to heat a lot of water. Thus, it takes a lot of energy to heat the ocean. The ocean stores more thermal energy in a surface layer ten feet deep than the entire atmosphere.
Water also cools down slower than air and land, for the same reason it takes longer to heat up. Imagine a hot summer in the tropics. If it’s cloudy for a day, the air and land might cool down, but the water will still be warm.