Complete a level with 50 rings and a giant ring will appear behind the end sign. If you jump into the giant ring you will advance to a bonus level. At the end of ALL bonus levels there is a Chaos Emerald. Only one emerald can be collected from any level after which the giant ring will stop appearing.
Run through the Casino Street Zone level and activate the 'slot machines' so you get extra lives. When you have collected the desired number of lives pause gameplay and leave the level to save those lives. Restart the level and repeat the process to get as many lives as you want.