From the Super Mario Wiki
Power Flowers are special flowers that have made a couple appearances in the Mario series. Two varieties of Power Flowers exist, each with their own attributes and features.
Power Flowers first appeared in Yoshi's Story. They grow from the ground and have a green stem with green leaves, as well as a yellow head with red petals, black eyes, and a small red mouth. The head of the Power Flower can be consumed by a Baby Yoshi, allowing the Yoshi to recover two petals on their Smile Meter. However, the Yoshi will get no ♥ by eating the flower, unlike eating a fruit or a Shy Guy, and thus consuming the plant does not improve Yoshi's Mood when the stage is completed. The head of the Power Flower quickly regrows after being consumed, which means that the Yoshi can simply keep eating flower heads until his health is fully recovered. The Power Flower is akin to the Spinning Heart of Super Mario 64, as both objects can be used to quickly (but not immediately) recover all HP.
Super Mario 64 DS
Another type of Power Flower appeared as ability granting flowers in Super Mario 64 DS. Their functions seem to replace Mario's cap abilities from Super Mario 64, with an extra addition. When Mario uses a Power Flower, he is able to float for a short time, similar to the P-Balloon in Super Mario World. At certain times, the ? Block will give Mario a Wing Feather, causing him to become Wing Mario and allowing him to fly (similar to the Wing Cap). If Luigi uses one, he becomes Vanish Luigi, becoming partially immaterial and able to move through certain objects to get to new places (similarly to the Vanish Cap). If Wario uses one, he becomes Metal Wario, gaining the ability to walk at normal speed underwater, as well as being able to withstand great winds (similarly to the Metal Cap). When Yoshi uses a Power Flower, he will turn into Fire Yoshi.