From the Super Mario Wiki
The Golden Hammer is an item that first appeared in Famicom game Wrecking Crew and reappears as an item in the Super Smash Bros. series starting with Super Smash Bros. Brawl. It is based on the Hammers found in the Mario series, which had the same uses and effects. It is similar to the Hammer from previous Super Smash Bros. games, except that the Golden Hammer is far more efficient. It stands on a pedestal, and when picked up, the player starts swinging the hammer up and down, devastating anyone who gets hit. It is swung faster than a normal Hammer. Repeatedly tapping the item button will allow the player to float in mid-air while holding this item, unlike the hammer. Each hit does 30% damage. It launches characters at a more horizontal line than a regular Hammer. Although the head does not fly off like the regular Hammer, it does have one other problem that will randomly occur; it will become the Golden Squeaky Hammer. The Golden Squeaky Hammer will only squeak if it hits someone instead of doing damage. However, it can still allow the player to float in midair.
The Golden Hammer can also be used to open the windows in Challenges. They can be earned by completing challenges that have windows containing Golden Hammers. There are only five Golden Hammers in Super Smash Bros. Brawl and Super Smash Bros. for Wii U, and three per panel in Super Smash Bros. for Nintendo 3DS. Golden Hammers cannot break windows that pertain to challenges related to Boss Battle Mode in Super Smash Bros. Brawl (PAL versions of the game, however, do not have this limitation) and certain other challenges in Super Smash Bros. for Nintendo 3DS.
The Ultra Hammer in Paper Mario and Paper Mario: The Thousand-Year Door resembles the Golden Hammer.
Super Smash Bros. Brawl
| Golden Hammer
|| NES Wrecking Crew
|| A hammer that glows with golden light. It's easier to swing than a normal hammer, and more powerful too. If you tilt the Control Stick and press the attack button repeatedly, you float in midair. It's a very powerful item, but one that rarely appears. There's also a Golden Squeaky Hammer that does absolutely no damage at all. It's what you would call a fake.
Super Smash Bros. for Nintendo 3DS
||This special hammer is several times stronger than the regular hammer. While wielding it, jumping repeatedly will let you float in the air. It doesn't appear often, so grab it when it does! However, watch out for the squeaky version. It looks like the normal one but is really useless.