He logged more than 1 211 hours in space during five shuttle flights, including the Endeavour mission in December 1993 to restore the Hubble Space Telescope to its full capacity. Hoffman was selected as an astronaut in 1978. He left the astronaut programme in 1997 to become NASA's European representative in Paris, France. In 2001, he was assigned by NASA to the Massachusetts Institute of Technology (MIT) as a professor of aeronautics and astronautics, also doing research projects there using the International Space Station.
In the 1970s, Hoffman played a leading role in developing the medium-energy X-ray experiment on the Exosat satellite for the European Space Agency. With the Massachusetts Institute of Technology (MIT) from 1975 to 1978, he worked on the analysis of X-ray data from the SAS-3 satellite operated by MIT. In 1986 he authored a book titled An Astronaut’s Diary.