“I had . . . no idea. . . . He was . . . flattering. He seemed to . . . to understand . . . to sympathize . . . ”
-- The Grey Lady (DH31)
c. 1944 – Tom Riddle, using his considerable charisma and charm, convinces the ghost of Ravenclaw House, Helena Ravenclaw, to reveal the secret hiding place of her mother’s long-lost diadem. Years later, she would confess to Harry that he seemed to understand her anguish and remorse. Some time later, probably after he left Hogwarts, Tom traveled to Albania, retrieved the diadem, and turned it into a Horcrux. He then returned to the school, feigned interest in taking a job teaching Defense Against the Dark Arts as a ruse to gain access to the Room of Requirement, and hid the Horcrux there (DH31).
The timeline of Tom Riddle's finding the diadem is impossible to decipher with certainty. Harry reasons that Riddle
"had traveled to that far-flung forest and retrieved the diadem from its hiding place, perhaps as soon as he left Hogwarts, before he even started work at Borgin and Burkes ... But the diadem, once it became his precious Horcrux, had not been left in that lowly tree ... No, the diadem had been returned secretly to its true home, and Voldemort must have put it there the night he asked for a job! He hid the diadem in the castle, the night he asked Dumbledore to let him teach! He must’ve hidden the diadem on his way up to, or down from, Dumbledore’s office!"
If this is true, then Riddle charmed the Grey Lady at some point during his time at Hogwarts but after he learned about Horcruxes, therefore between the summer of 1943 and the summer of 1945.
The Room of Requirement is located on the seventh floor of Hogwarts castle. However, according to book four, the entrance to Dumbledore's office is very likely on the second floor (GF28). This is one of the few instances where Rowling's mental map of the castle failed her. There is no logical way that Riddle would have had to travel to the seventh floor to get to Dumbledore's office to ask for the job. So in book six, Rowling moved Dumbledore's office to the seventh floor. If asked, I'm sure she would just say that the castle is magical and things move around. Here's how Rowling responded when a fan asked if she had a blueprint or map of the school:
No, because all those staircases keep shifting around and rooms pop out of nowhere, and stuff just moves too much. But I have got a notebook that reminds me what floor everything is on, just to keep track. Of course, if anything moves, I can blame it on magic, not my mistakes (Sch1).