You can earn as many as three stars, depending on how many points you make during a level. The display at the top of the screen shows how many stars you've earned so far in the level. Tap on it to see how many points you need to earn all three stars.
At the end of the level, stars you've earned go into the Star Chest on your Home screen. Fill the Star Chest to open it and earn various rewards.
If you beat a level but earned less than three stars, you can replay the level to try for the stars that you missed. However, you can never earn more than three stars from any level, no matter how many times you replay it.
NOTE: There are three sizes of Star Chests. The smallest chest takes the fewest stars to open, but also has lesser rewards. The largest chest takes the most stars to open, but (I bet you already guessed this) it has the juiciest rewards.