In total there are 21 Bonus Stages, with one to be unlocked in each level of the game. They are unlocked by using a specific head action at the corresponding head action prompt. You will naturally unlock all Bonus Stages as you work towards the Now That's Using Your Head trophy. Once you begin the Bonus Stage you only get one life so if you fall you will die and return to the normal level, without having lost any lives or heads. The Bonus Stages themselves are pretty straight forward, you just have to collect Moonsparkles and progress through the level and reach the end before the time runs out. All unlocked Bonus Stages can be replayed at any time at the Act select screen, under the 'Bonus Stages' menu.
Refer to the Now That's Using Your Head (Hur, Hur) trophy below for the exact location and required head actions to unlock all Bonus Stages. These are highlighted by the 'BONUS STAGE' tag at the end of their description.