Hafellner started developing an interest in lichens while he was a student at this institution, studying under Josef Poelt.
He earned a master's degree in 1975 and a PhD in 1978, defending a doctoral thesis about the genus Karschia.
[3] His 1984 work Studien in Richtung einer natürlicheren Gliederung der Sammelfamilien Lecanoraceae und Lecideaceae has been described as "probably the single most influential publication in lichen systematics in the latter half of the 20th century".
He has made about 100,000 scientific collections of specimens, including about 8000 lichenicolous fungi.
A complete listing of Hafellner's 289 scientific publications up to 2016 is given in Grube and colleagues' commemorative article.