Both exist, but neither has ever appeared in a game. They are comic-exclusive forms.
Ultra Sonic is the base state Sonic assumes after collecting a large number of rings — around a thousand, by most accounts. Its distinguishing trait is adaptability: his form shifts with the climate around him.
That produces several variants. Solar Sonic takes over in hot, arid environments such as deserts, Eco Sonic in forests, and Polar Sonic in ice caps. Because the mechanic depends on the Archie comics continuity, none of it carries over to the games.