You may lose a star if you lose a match. If you lose too many stars, you will be demoted to a lower rank. But don’t worry, you always have an opportunity to regain stars and be promoted as you play more and defeat more opponents.
When you rank down, your stars will reset back to 2. This gives you a chance to challenge players at that rank a few more times to see if that is the rank you should be at.