From the Super Mario Wiki
Retrieved from "http://www.mariowiki.com/index.php?title=Jellyfish&oldid=1836593"
Jellyfish are giant water-dwelling creatures that live around Yoshi's Island. They are invincible to all known means of defeat, and have a greed for intruders to their waters. Jellyfish come in Blue, Red, and Green. Blue Jellyfish simply move up and down. Red Jellyfish chase Yoshi. Green Jellyfish simply float in place. Red Jellyfish can sometimes have an item like a Fruit or a Heart Fruit.
It is entirely possible that Jellyfish are related to Jelectros, another type of jellyfish enemy found in Super Mario Bros. 3. Pre-Yoshi's Story jellyfish also appeared in Super Mario World 2: Yoshi's Island, going under the name "Preying Mantas".
Mario & Wario
In Yoshi's Story, Jellyfish only appear in the level Lots O'Jellyfish!. Green ones don't appear until the third part of the level. Blue jellyfish go up and down, red jellyfish will chase Yoshi and green jellyfish just hover.
Super Mario Galaxy
In Super Mario Galaxy, Jellyfish appear in a few galaxies, in the Deep Dark Galaxy and the Bigmouth Galaxy. In this game, they are blue, and are very large. If Mario comes in contact with one, he will be shocked. They could only be defeated by hitting them two times with a Koopa Shell, and would give one Coin when defeated.
Super Mario Galaxy 2
Donkey Kong Country: Tropical Freeze
In Donkey Kong Country: Tropical Freeze, Jellyfish appear as common enemies in the water levels.