Automatically, there is a scene where Clumsy Ninja stands up and pays attention. Then Sensei rewards your hard work with the belt. The ninja bounces around all happy. Normally you earn belts when you level up straight away.
Unlocking belts follow a certain alternating pattern, where one level would have no belt, and the next level after that would have a belt. It goes on and on, except levels 39-50, where you can unlock belts at every level. This is possibly because the XP on levels 45-50 would require about 1 million or more XP to level up.