Stars show how well you beat the level! You also need a particular number of stars for unlocking challenges - specific levels that you need to beat in order to unlock the next diorama.
You always get one star for winning the level. Additionally, you can obtain 2 extra stars if you complete additional goals: beat the level with having enough turns left and using a particular number of boosters.
For example, if you want to achieve 3 stars on level 118 (see the picture above), you have to:
1 - get rid of 4 red pieces (the main goal)
2 - do it in 21 turns or less (26 base turns minus 5 turns)
3 - use 12 Boosters during your game
❗ Right now the game is made in a way that you can't win stars separately. So in order to get 3 stars on a level, you need to achieve them all at once in a level.