He knew his ancestry before making Horcruxes.
The Dark Lord knew his ancestry before he made his first Horcrux. He began his search by looking for his father in wizarding records, but was unable to find any evidence of him in them.
“It seems that he searched in vain for some trace of Tom Riddle Senior on the shields in the trophy room, on the lists of prefects in the old school records, even in the books of wizarding history. Finally he was forced to accept that his father had never set foot in Hogwarts. I believe that it was then that he dropped the name for ever, assumed the identity of Lord Voldemort, and began his investigations into his previously despised mother’s family – the woman whom, you will remember, he had thought could not be a witch if she had succumbed to the shameful human weakness of death.”
- Harry Potter and the Half-Blood Prince, Chapter 17 (A Sluggish Memory)
When he was sixteen, he discovered the Gaunt line, and that he was a descendant of Salazar Slytherin. When he went to find the Gaunts, he knew they were his relatives - that’s why he sought them out.
“All he had to go upon was the single name “Marvolo”, which he knew from those who ran the orphanage had been his mother’s father’s name. Finally, after painstaking research through old books of wizarding families, he discovered the existence of Slytherin’s surviving line. In the summer of his sixteenth year, he left the orphanage to which he returned annually and set off to find his Gaunt relatives. And now, Harry, if you will stand …”
- Harry Potter and the Half-Blood Prince, Chapter 17 (A Sluggish Memory)
Whether he made the diary or the ring into a Horcrux first, he would’ve known his ancestry first. He made the diary into a Horcrux because it was proof he was he Heir of Slytherin, so he had to have known first.
“Lord Voldemort liked to collect trophies, and he preferred objects with a powerful magical history. His pride, his belief in his own superiority, his determination to carve for himself a startling place in magical history; these things suggest to me that Voldemort would have chosen his Horcruxes with some care, favouring objects worthy of the honour.’
‘The diary wasn’t that special.’
‘The diary, as you have said yourself, was proof that he was the heir of Slytherin; I am sure that Voldemort considered it of stupendous importance.”
- Harry Potter and the Half-Blood Prince, Chapter 23 (Horcruxes)
When he comes out of the diary, he does somewhat imply that he knew about the existence of the Chamber for five years before opening it, but he may be obliquely referring to discovering his ancestry and then through that realizing he could open the Chamber instead.
“But I admit, even I was surprised how well the plan worked. I thought someone must realise 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!”
- Harry Potter and the Chamber of Secrets, Chapter 17 (The Heir of Slytherin)
He only took the ring after going to find the Gaunts, and when he found Morfin, he soon took his wand and used it to kill the Riddles. He did this because he wanted to kill the Muggle who abandoned his mother.
“Voldemort Stupefied his uncle, took his wand, and proceeded across the valley to “the big house over the way”. There he murdered the Muggle man who had abandoned his witch mother, and, for good measure, his Muggle grandparents, thus obliterating the last of the unworthy Riddle line and revenging himself upon the father who never wanted him. Then he returned to the Gaunt hovel, performed the complex bit of magic that would implant a false memory in his uncle’s mind, laid Morfin’s wand beside its unconscious owner, pocketed the ancient ring he wore and departed.”
- Harry Potter and the Half-Blood Prince, Chapter 17 (A Sluggish Memory)
At that point, he knew his entire history - he already knew both that he was related to the Gaunts and through them to Salazar Slytherin, and he knew Tom Riddle Sr. was a Muggle.