Hamm was born in the village of Gat near Belišće and Valpovo. In 1924 he finished the classical gymnasium in Osijek, and in 1929 he graduated in Slavic and Germanic studies at the University of Zagreb.
He worked as a lecturer at the gymnasiums in Pristina, Karlovac and Zagreb. In 1931 he became a part-time lector for Polish at the Faculty of Philosophy in Zagreb. In 1934 he receives his Ph.D. with the thesis Matija Petar Katančić, njegova djela i njegov dijalekt ('Matija Petar Katančić, his works and dialect'). In 1946 he became permanent lector for Polish. In 1948 he received a position of docent for Slavic philology, with special care for Old Church Slavonic. He became an associate professor in 1954, and a tenured professor in 1958.
In 1960, he accepted the position of a regular professor of Slavic philology at the Department for Slavic studies of the University of Vienna, as well as the position of the head of the Institute for Slavic philology in Vienna. He also served as the head of the Linguistic department of Balkan commission (founded by Vatroslav Jagić in 1897) of the Austrian Academy of Sciences. He was a regular member of the Austrian as well as the Yugoslav Academy of Sciences and Arts.
Hamm died in Vienna at the age of 81, and was buried in Zagreb.