The seven gems in question are the Chaos Emeralds, and in the classic games you earn them by clearing the Special Stages rather than finding them lying around.
Reach the end of a zone with enough rings, jump through the giant ring, and you drop into a rotating maze where you have a limited time to grab the Emerald. Collect all seven and Sonic can transform into Super Sonic.
Expect plenty of retries. The Special Stages are timed and unforgiving, and most players need several attempts per Emerald.