From the Super Mario Wiki
Gold Flowers are power-ups which appear in New Super Mario Bros. 2 for the Nintendo 3DS. They first appear in World 2-1. When collected, Mario will turn into Gold Mario and be able to shoot golden fireballs that explode and do splash damage when they hit blocks, enemies, or walls. If enemies are hit by the projectiles, they will yield an amount of coins. These fireballs are capable of taking out stronger enemies that are normally immune to regular fireballs. Even Bowser can be taken out with a single gold fireball, as evidenced with the Gold Classics Pack. Jumping on enemies (which can be jumped) also turn them into coins. Mario can also transform several Brick Blocks at once into coins with a fireball shot. Blocks with items will be activated instead. If Luigi makes contact with a Gold Flower, Luigi will become Silver Luigi. If Gold Mario or Silver Luigi beat a level, they return to Fire Mario/Luigi respectively. If either comes in negative contact with an enemy, they will revert to Super form.
The Mario Bros. can also receive a free Gold Flower from Toad, if they were to find and enter Toad's Star Toad House. The Gold Flower has higher priority than most other items, meaning that only the Star can replace this item in the player's inventory. Outside the inventory, only the Mega Mushroom and the Invincibility Leaf have higher priority than the Gold Flower, and if Mario or Luigi are under the effects of the Invincibility Leaf when they get hold of a Gold Flower, it is placed in the player's inventory. The Gold Flower is the only power-up (aside from the Super Leaf) that makes an unique noise when coming out of a Question Block and when being used to transform.
Names in Other Languages