Pinheads are enemies that appear in Super Mario Galaxy 2. They look like bowling pins and have two beady eyes and a bright yellow antenna. They can only be defeated when Mario transforms into Rock Mario. When Mario walks over to them, they hide in holes underneath themselves, but when he is Rock Mario, they get scared and tremble. These are rare enemies who only appear in Boulder Bowl Galaxy and Melty Monster Galaxy.
When Rock Mario hits some Pinheads, it's similar to bowling. Rock Mario is meant to be the bowling ball, and the Pinheads are meant to be the bowling pins.
Pinheads most likely got their names from bowling pins, due to their similar traits.