Gahm was born in Stockholm. He is the professor emeritus of astronomy at Stockholm University. Until 2010, he was the chairman of the Swedish Astronomical Society. He is the main initiator of the popular science project Sweden Solar System.