By either giving heat energy to the water or taking heat energy from the water. Knowing the temperature of a liquid product entering a biological environment can be an important metric if the temperature difference is significant. So we can assume there is no heating of the oil as it blows up through the well hole just prior to entering the ocean ?
The temperature of the oil will actually drop as it goes from high to low pressure (that’s why they had trouble with ice crystals in the cap), and it will pull heat from the nearby water which will cool it. But the mass of the oil is miniscule compared to that of the surrounding sea, and the cooling of the water will be insignificant, except in a very localized way. If you put a drop of cold oil into a bucket of water, the temperature doesn’t change much.