Stars allow you to unlock particular puzzles, and therefore to access these puzzles.
You receive from 1 to 3 stars each time you successfully complete a puzzle. If you complete a puzzle quickly with very few moves, you obtain the maximum number of stars (3). Therefore, earning a maximum number of stars allows you to access more puzzles.