Look to the Visitation for the answer. Obviously, Jesus and John recognized each other as persons when the were introduced at the Visitation. John heard Mary's voice and immediately he leaped in mother's womb. The Church teaches that at that moment he was freed from original sin in preparation for his role as precursor of the Lamb. We know from the angel's message that John was about six months old. How old was Jesus? We can figure that out pretty closely from the gospel which tells us that Mary "went in haste" to visit her cousin.
Elizabeth and Zechariah lived not far from Jerusalem so Mary's journey from Nazareth was 80-100 miles, at most a week for the journey, but probably less, perhaps three or four days. That means Jesus was less than a week old when mother and babe arrived and greeted Elizabeth. Already, however, John recognized Jesus as His Lord and Savior and leaped for joy.
Think of fetal development. Jesus was actually making the journey along the fallopian tube while his mother walked or was carried by a beast along the road toward Jerusalem. It takes about a week for the newly conceived child to reach the uterus and embed there. So Jesus was a tiny embryo. How big? Look at the head of straight pin used for sewing. Jesus was probably no bigger than that at the Visitation. And yet He performed His first miracle that day releasing John from Adam's sin. The Visitation teaches us a lot about personhood. The relationship between John and Jesus occurred when Jesus was less than a week old and illustrates His personhood at that young age. Surely all of us, made in the image and likeness of the Word made flesh, receive that same gift from God. Our personahood was well established in the first week of life. Praised be to God who made the heavens and the earth and gave each of us the glorious gift of life!