Dumbledore wasn't even at Godric's Hollow when Voldemort attacked the Potters, so how was he able to know a piece of Voldemort was inside Harry if he wasn't even there to see the tragic moment happen?
He was not at the Potter's home, but he had exceptional intelligence and logical thinking. Following points crop up :
1. Parsletongue was a rare ability. It was only in the persons having some connections to dark side, especially Salazar Slytherin. And Dumbledore knew None of Harry's ancestors were Slytherin. (They were Perwell's). And the closest persons he knew to be connected to Slytherin were the Gaunts, and Voldemort. Thus he logically could have deduced, there was some factor inside harry that connected him and Voldemort.
Hermione: I don't know, Harry, but it sounded like you were egging the snake on or something. Harry, listen to me. There's a reason the symbol of Slytherin house is a serpent. Salazar Slytherin was a parselmouth, he could talk to snakes too.
Ron: Exactly! Now the whole school is gonna think you're his great-great-great-grandson or something....
2. In OOTP, when he finds the connection between Harry and Voldemort, he figures out to be connection of souls. Because Hogwarts protective charms were enough to hold external penetrations outside, there must be something inside Harry directly connected to Voldemort that helped him plant memories in Harry's mind. Not only Voldemort played with Harry's Memory, He also penetrated his mind.
"On those rare occasions when we had close contact, I thought I saw a shadow of him stir behind your eyes. . . ." said Dumbledore.
3. One more but not so significant instance is that Harry and Voldemort's wand were twins. This was a very rare combination. Since wands chose Wizard, The wand must have found something in Harry that of Voldemort so that the same cored wand chose Harry.
"Yes" said Dumbledore "Mr Ollivander wrote to tell me you had bought the second wand, the moment you left his shop four years ago."
This may be because it was Fawkes feather wand, but this may have initiated a thought in Dumbledore's mind about the plausible connection between Harry and Voldemort.
I believe these sources were enough for Dumbledore to conclude that there was some piece of Voldemort living in Harry after the tragedy occurred.