According to the Whale and Dolphin Conservation, some species of whales, such as the sperm whale, can stay underwater for approximately 2 hours. This allows them to dive to extreme depths in order to hunt prey, such as squid.
The sperm whale, as National Geographic elaborates, has the largest brain of any animal on Earth. A waxy substance called spermaceti, which whalers believed was sperm, is located within the head cavity of the sperm whale. Its function is unknown, but scientists speculate that spermaceti may allow the sperm whale to alter its buoyancy and assist in diving and rising, as the substance hardens when exposed to the cold.