Each energy type has different effects while underwater. Originally, it was GM Fiat, but since the release of Aquatic Adventures, we got official rules about each energy type.
Acid spells from the Conjuration school does not work underwater at all (like Acid Arrow), but Evocation spells work normally (like Dragon Breath or an acid fireball).
Cold spells that simply deal cold damage, but does not create ice, will deal half cold damage and half piercing damage, due to the cold creating ice shards underwater. Spells that create ice will work normally.
Electricity spells will not disperse nor conduct (unlike mundane electricity). They also will look invisible underwater, so any target who fails to identify an electricity spell being cast will be flat-footed against ranged touch attacks caused by the spell. But melee touch attacks work normally.
Fire spells have a chance to become steam, instead of not working at all underwater. This requires a caster level check (DC 20 + spell level). The steam will deal fire damage normally, but has no chance of setting things on fire, nor it will extend beyond the water body (so a fireball couldnt hit targets outside of the water). There is no check required if you got the Steam Spell feat.
Sonic spells work the same. But at GM's discretion, the caster may double the range or area, halve the damage and decrease the spell's DC by 2 instead of the normal effects.
Those aren't really energy spells, but for completeness, they are also listed here:
Cloud and Weather spells, like fogs, will not work underwater. Except those affected by the Murky Spell feat. Spells like Sleep Storm or Ice Storm will not work underwater. But Twilight Haze, being an illusion, works normally.
Invisibility spells will work underwater, but the water is displaced. Meaning that anyone can still locate the creature, but they still benefit from total concealment. The Invisibility Bubble spell will not displace the water.