From the Super Mario Wiki
The Gooey Bomb is an explosive item that appears in Super Smash Bros. Brawl and Super Smash Bros. for Nintendo 3DS / Wii U as a weapon. It is mentioned that the Gooey Bomb is similar to the Motion-Sensor Bomb from Super Smash Bros. Melee, as, like the Motion Sensor Bomb, players can attach the Gooey Bomb to surrounding terrain; unlike the Motion-Sensor Bomb though, players can also attach the Gooey Bomb to opponents. The only way to remove a Gooey Bomb once it has been affixed to a character is to have that character run into another opponent, causing the Gooey Bomb to stick to them instead. After a few seconds have passed, the Gooey Bomb blows up, dealing damage to the opponent it's stuck to and anyone in its vicinity.
Super Smash Bros. Brawl
Super Smash Bros. for Nintendo 3DS / Wii U