Whales and dolphins are mammals and must breathe air to survive. Furthermore, unlike humans and other mammals, they are 'voluntary breathers', which means they must physically remember to go to the surface and breathe!
Depending on the species of whale or dolphin, lung capacity differs. But, they all return to the surface of the water, open a blowhole on the top of their heads (a watertight valve) expel air and quickly take in new before going down below the water's surface.
^all this is not true^