You have to reach the Target Score of that level, with a limited number of puzzles.

If you win, you move to the next level, if you lose, you go back to the previous checkpoint.