From the Super Mario Wiki
Super Mario Bros. 2
Whales appeared in level 4-2 of Super Mario Bros. 2. Players can hop on their backs and gain elevation by standing on their blow holes as water sprays out. The water will hurt the player if they touch it from either side but a Star can be used to destroy the spout. Pink (blue in remakes) Snifits and Shy Guys patrol the backs of some whales. There is also one whale which has grass growing on its back.
A whale has made an appearance in volume 8 of Super Mario-Kun. Toad and Birdo ride on a whale that crashes through the sky literally. It flattens the Fryguy that is fighting Mario, Luigi, and Yoshi. The whale then takes Mario, Luigi, and Yoshi to a castle in the sky.
Super Mario Land series
Super Mario Land 2: 6 Golden Coins
Wario Land: Super Mario Land 3
WarioWare, Inc.: Mega Microgame$!
Donkey Kong Country Returns
In Donkey Kong Country Returns and Donkey Kong Country Returns 3D, the level Blowhole Bound features whales that Donkey Kong and Diddy Kong can ride on. After freeing a whale from an anchor, the Kongs can ride on its back to cross the water along the shore of the islands. The whales are not very steady and often tilt along the water, allowing the primates to grab some collectibles hidden high in the air. The aquatic creatures sometimes head underwater as well, where the Kongs cannot swim, so the heroes have no choice but to use floating ship parts to progress. These ship parts are often destroyed by the fast-moving whales, so the Kongs have to travel across them quickly. By hand-slapping the whales' blowhole, the Kongs can force the whale to send water out that they can use to reach pickups in higher areas. The whales in the game look similar to a sperm whale.
Super Smash Bros. for Nintendo 3DS
In other media
The Super Mario Bros. Super Show!
A Whale briefly appeared towards the end of The Super Mario Bros. Super Show! episode "Mario of the Deep". Here, the Whale was rode on by King Neptune, who was using it to body slam his temple, which Barra-Koopa had taken over, along with the rest of Aqua Land. After slamming into the wall several times, the Whale caused a piece of it to shatter away, which Mario, Luigi, Princess Toadstool and Toad were able to pass through. This Whale appeared to be a Blue Whale rather than the variety of Whale from Super Mario Bros. 2.
A Whale makes a cameo in Nintendo Monopoly.