Assuming we're talking about 5e here, I could only really find 3 explicit rules (see 1 - 3 below), two of which pertain to spell components and don't mention water at all but that do raise important points.
I've added a bunch of questions you may want to consider relating to each point, and several others have given some good ideas about how spells or material components might not work as expected.
1. Creatures and objects that are fully immersed in water have resistance to fire damage. (PHB 198)
- As such, I would suggest avoiding any further penalties to fire magic.
- Recall also that resistances from multiple sources do not stack, so a demon with fire resistance also fully submerged in water only halves the fire damage once.
2. A character who is gagged or in an area of silence can't cast a spell with a verbal component. (PHB 203)
- Is a character considered "gagged" when underwater?
* What if they have a swim speed? See for example attacking with melee weapons.
* What if they can breathe underwater?
- See also
https://rpg.stackexchange.com/quest...-be-cast-underwater-if-the-caster-cant-breath
3. A character must have free use of at least one hand cast a spell with a somatic component. (PHB 203)
- Normally, a character can move and cast a spell at the same time; does swimming always require the use of both arms and hands, and if so, does that preclude casting somatic spells and moving in the same turn?
* Would the above ruling apply equally to Material components? What if it's a focus?
4. Assuming a spell is successfully cast, there do not appear to be any rules indicating that the spell effect will deviate from the spell description, regardless of whether that spell is cast in water or air unless otherwise specified by the spell itself. Thus, casting Shocking Grasp or Lightning Bolt while underwater behaves exactly as written, not electrocuting nearby creatures as real-world physics might otherwise suggest.
- Will this be the case for all spells, or will some be subject to physics?
* For example, fog cannot form in water; will the spell Fog Cloud simply fail if cast underwater, or will it work because "magic"?
- See
https://rpg.stackexchange.com/questions/95717/what-happens-when-you-cast-fireball-under-water
- See
https://rpg.stackexchange.com/questions/136108/what-happens-to-lightning-spells-underwater
Additonal thought: if the target of a spell is fully immersed in water and the spellcaster is not, does the water count as cover or concealment? See e.g.
https://rpg.stackexchange.com/questions/107741/can-you-cast-spells-through-water