Every Blue Sphere stage in Sonic Mania has a preset amount of rings to collect.
I haven't been able to notice any gameplay changes when collecting them. They don't seem to change Sonic's speed, nor do I keep the rings after completing the bonus stage.
What does collecting rings do in Sonic Mania's Blue Sphere game?
Best Answer
According to Eurogamer, collecting every ring in a bonus stage earns you a 'Perfect', which is required for getting a Gold Metal.
Screenshot from Giantbomb's 'Quick Look: Sonic Mania'
Sources