After being freed, Dobby begins searching for paid work. He travels all over the country looking for a job and being turned away by people who wanted nothing to do with a freed house-elf who wore clothes and wanted to be paid (GF21).
Dobby finally gets work at Hogwarts in late November or early December 1994. Shortly after coming to Hogwarts, Dobby says that his job search lasted two years (GF21). Since Dobby was freed in late May 1993 (CS18), however, it was more like a year and a half from the time he stopped serving the Malfoys and the time he started working at Hogwarts.