There are 140 levels. At level 50 the game offers a choice: continue into free play mode and keep going until you run out of lives, or stop there.
I know because I hit 49 and a little speech bubble at the bottom of the screen spelled it out — immediately before I lost to ten brown balloons.