You need to collect enough stars. How many exactly that is, depends on the level. Early in the game it can be as low as 9 stars, and later it can be as high as 15. If you finish all the rounds and don’t collect the required number of stars, you can get an opportunity to advance to the next level even without collecting those stars. Just keep in mind, the next level won’t be any easier!