The Bee Mushroom was one of the power-ups in Super Mario Galaxy and the Bee Mushroom helped Mario by turning Mario into a Bee that made Mario fly, until the flight gauge reaches zero and Mario will descend slowly and when you land on the ground the flight gauge will fill up and you can fly again.
The Bee Mushroom has appeared in Super Mario Galaxy and Super Mario Galaxy 2. this power-up is usually found in places that is Forest themed like Honeyhive Galaxy and Honeyclimb Galaxy, sometimes you can find the Bee Mushroom in a tropical themed galaxy like Sea Slide Galaxy. In Super Mario Galaxy 2, the Bee Mushroom comes back and helps Mario through the galaxies in the game.
The Bee Mushroom like all the other power-ups has several ways to revert Mario back to normal. The more obvious way is to take damage, and another way is to touch water to revert Mario back to normal.