I think it is important to maintain a fine balance on this issue, a balance struck at the Council of Chalcedon, which stated that Christ is “perfect in divinity and perfect in humanity, the same truly God and truly man, of a rational soul and a body; consubstantial with the Father as regards his divinity, and the same consubstantial with us as regards his humanity; like us in all respects except for sin.”
Note the dual emphases - he is perfect in divinity AND perfect in humanity; he is truly God AND truly man; he is consubstantial with the Father AND consubstantial with us. Denial of EITHER his true divinity OR his true humanity is heresy, and both heresies have had their heyday throughout Church history (e.g. Arianism and Docetism).
Obviously in modern times the tendency has been to overemphasize his humanity, even to the point of denying his true divinity which he possessed at all times. But our response in defending his divinity cannot be to denigrate his true humanity; we must maintain the same balance as the Chalcedon Fathers.
Thus, there can be no question that Jesus was God from eternity, and that he was as much God in the womb as he was as an adult or now in glory. He did not obtain his divinity at some point such as his Baptism or resurrection; he is eternally begotten of the Father.
Yet, he was truly a man like us. He had to learn how to talk, how to walk, and who he was. As an infant, he had an infant brain that had the capabilities of an infant brain (albeit one without sin weighing it down).To denigrate or deny this reality is just as serious as denigrating or denying his divinity, and it calls into question the beautiful doctrine of the Incarnation.
But ultimately this reality is a mystery we will never understand, at least this side of heaven. Neither Scripture nor the Church has seen fit to define exactly the details of the knowledge the child Jesus had of his divinity, and thus we must leave it unanswered and realize that the question is not one God deems it important for us to know.