... but I admit, even I was surprised how well the plan worked. I thought someone must realize that Hagrid couldn't possibly be the Heir of Slytherin. It had taken me five whole years to find out everything I could about the Chamber of Secrets and discover the secret entrance ... as though Hagrid had the brains, or the power!
-- Tom Marvolo Riddle (CS17)
He is in his first year at Hogwarts when he learns about the existence of the Chamber. He is determined to find it but doesn’t succeed until five years later, in June of 1943.
Tom tells Harry that it took him five years to work out how to open the Chamber once he'd heard about it.
It had taken me five whole years to find out everything I could about the Chamber of Secrets and discover the secret entrance (CS17)
Since the Chamber was opened in June of 1943, he first heard about it in the autumn of 1938.