No, whales are unable to breathe underwater.
Whales are marine mammals which means they are warm-blooded, produce milk, give birth and breathe air.
Whales breathe through their blowhole(s) and inhale/exhale oxygen when they are above the surface of the water.
When they dive the muscles surrounding their blowholes contract allowing the whale to swim underwater without having to fear anciently inhaling water.
When you see water spout from a whales blowhole that means that the whale is exhaling.
The water that spouts into the air comes from the water surrounding the blowhole, not water that was ingested by the whale.
If a whale were to inhale water into its blowhole the water would enter the whales lungs and the whale could drown.
The reason whales breathe through their blowhole and not their mouth is because the trachea (air passage) and esophagus (food passage) are not connected.
Whales are also known as conscious breathes and have a lot of control over their oxygen supply and breathing.
The reasons for this is because of the fact that whales live in the ocean and must always be conscious of their breathing.
If a whale were to pass out or fall asleep while in the ocean there is a good chance it would sink and drown.
Because of this fact the whales brain never fall completely asleep.
While they rest half of their brain goes into restful state while the other half remains active allowing them to respond to danger immediately and swim back to the surface for more air when necessary.
Sometimes these marine mammals can be seen logging across the surface of the ocean laying motionless so that they can easily inhale air without the fear of drowning.
It is believed that whales are also capable of sleeping while submerged but are likely to stay close to the surface so that they can come up for air when necessary.
Whales have been recorded resting for extended periods of time and have also been seen take several short naps over the course of a day in order to give their brain and their body the rest it needs so that they can perform their daily tasks effectively and efficiently.
Due to their large size most of what we know about a whales breathing and sleeping habits comes from the dolphin species since whales are typically too large to observe in close detail using brain motioning technology.
All three species must come to the surface in order to breathe and none of them are born with gills or specialized lungs that would allow them to extract oxygen from the water.
They are however capable of inhaling much more air than carbon dioxide as compared to humans which helps them bring more oxygen into their blood stream and allows them to hold their breath for longer periods of time.
In fact these marine mammals have been recorded holding their breath anywhere from five minutes up to an hour and a half depending on the species.