The game ends when you solve the puzzle, or the poor gingerbread man is all gone. Totally free. No in-app purchases. Over 5000 puzzles.