The name is a direct nod to his defining trait: he can run at supersonic, "sonic" speeds.
In the games and cartoons, Sonic was simply born with both his speed and his blue color. In the British comics, though, he gained them through a scientific experiment involving a Chaos Emerald, and that same experiment is said to have created his nemesis, Dr. Ivo "Eggman" Robotnik.
From a marketing angle, Sonic was colored blue to complement his signature red-and-white sneakers and evoke a bold, patriotic look. His blazing speed was chosen to show off the Sega Genesis, which was marketed as being able to process information faster than its competitors. The name, the color, and the speed all worked together to sell the system.