From the Super Mario Wiki
Not to be confused with Clampy
Clams are giant bivalves with eyes that are found in the seas surrounding the Mushroom Kingdom and Yoshi's Island. They appear as semi-recurring enemies and obstacles throughout the Mario series.
Super Mario World 2: Yoshi's Island / Yoshi's Island: Super Mario Advance 3
In Super Mario World 2: Yoshi's Island and Yoshi's Island: Super Mario Advance 3, small Clams appear as enemies in certain levels.
In Yoshi's Story, they are generally harmless, but act much like underwater Warp Pipes from Super Mario Bros. 3, by blowing air up (nonetheless, these actually stop after a certain amount of time). Clams are usually found around Sea Cactus. They are rare, and even then they only appear in Stage 5-2: Lots o' Fish.
Super Mario series
Super Mario 64
A Clam from Super Mario 64
In Super Mario 64, Clams appear, but they don't have life and are just objects that have items in them. They appear in Jolly Roger Bay and Dire, Dire Docks. In Jolly Roger Bay, many of the clams have a Red Coin in them, and one even has a Koopa Shell inside.
Super Mario Sunshine
Although actual Clams do not appear in Super Mario Sunshine, a Clam-themed ride called clam cups can be found in Pinna Park where if Mario shoots them with water they will open up to reveal an item.
Super Mario Galaxy
A Clam also appears in Super Mario Galaxy only in the Beach Bowl Galaxy. Like in Super Mario 64, it holds treasures inside such as Star Chips and Coins.
New Super Mario Bros. Wii
In New Super Mario Bros. Wii, a clam subspecies called Clampys appear in World 1-4 and 4-1. They hold treasures such as 1-ups and coins in their valves, and may trap a playable character.
Super Mario Galaxy 2
A single Clam appears again in the sequel Super Mario Galaxy 2 in the Starshine Beach Galaxy.
Names in other languages