There is a passage in The Life and Lies of Albus Dumbledore which seems to imply that there was a five year gap between the time that (eighteen-year-old) Dumbledore parted ways with Gridelwald and their epic duel:
Neither Dumbledore nor Grindelwald ever seems to have referred to this brief boyhood friendship in later life. However, there can be no doubt that Dumbledore delayed, for some five years of turmoil, fatalities, and disappearances, his attack upon Gellert Grindelwald.
(Harry Potter and the Deathly Hallows, Chapter 18)
However, the duel was in 1945, which would make Dumbledore born in 1922, and only four years older than Voldemort. Hardly enough to be his teacher.