From the Super Mario Wiki
As the Yoshis in Yoshi's Story look for the Super Happy Tree, they follow a trail of fruits. One of these fruits is the Heart Fruit. The Heart Fruits can be found in Bubble Pops or when a Yoshi eats 6 Melons in a row, the Heart Fruit will appear from the sky as it slowly floats down. The Heart Fruit transforms Yoshi into Super Happy Yoshi. In this form he is invincible and stronger and sometimes reveals some extra coins in the level within the time limit. While Super Happy, Yoshi is given endless supplies of Yoshi Eggs, a longer tongue, and extra Flutter Jumping. When a Yoshi Ground Pounds the ground while being Super Happy, the Bubble Pops and Shy Guys will turn into Fruit and the Peppers will turn into Heart Coins only on the screen. When Yoshi transforms, his health will be filled completely. The Heart Fruit looks like a red heart with a face on it. Some are big, and some are small. If a Yoshi eats a Black Shy Guy or some Pepper while being invincible, the Yoshi gets hurt and the invincibility magic cuts off as the Yoshi is back to normal.