The Bible calls Jesus a "child" and says that He was in a "house" when the "Wise Men" came to visit. We are not told how old Jesus was at the time, but it is thought that He had to be less than two years old because Herod killed all children two years old and younger. (It is known that Herod died about 4 BC which would make Jesus closer to just a few months old.)
After the Wise Men left, Joseph was warned in a dream to take Jesus and Mary, leave Bethlehem and go to Egypt. Jesus life was in danger, because Herod was very angry that the Wise Men did not return to Jerusalem to tell him where Jesus was. Herod claimed to want to worship the new King, but he really had planned on killing Jesus once he knew His location.
From the book of Matthew:
2:1 Now when Jesus was born in Bethlehem of Judaea in the days of Herod
the king, behold, there came wise men from the east to Jerusalem,
2:2 Saying, Where is he that is born King of the Jews? for we have seen his star
in the east, and are come to worship him.
2:3 When Herod the king had heard [these things], he was troubled, and all
Jerusalem with him.
2:4 And when he had gathered all the chief priests and scribes of the people
together, he demanded of them where Christ should be born.
2:5 And they said unto him, In Bethlehem of Judaea: for thus it is written by
the prophet,
2:6 And thou Bethlehem, [in] the land of Juda, art not the least among the
princes of Juda: for out of thee shall come a Governor, that shall rule my
people Israel.
2:7 Then Herod, when he had privily called the wise men, inquired of them
diligently what time the star appeared.
2:8 And he sent them to Bethlehem, and said, Go and search diligently for the
young child; and when ye have found [him], bring me word again, that I may come
and worship him also.
2:9 When they had heard the king, they departed; and, lo, the star, which they
saw in the east, went before them, till it came and stood over where the young
child was.
2:10 When they saw the star, they rejoiced with exceeding great joy.
2:11 And when they were come into the house, they saw the young child with Mary
his mother, and fell down, and worshipped him: and when they had opened their
treasures, they presented unto him gifts; gold, and frankincense, and myrrh.
2:12 And being warned of God in a dream that they should not return to Herod,
they departed into their own country another way.
2:13 And when they were departed, behold, the angel of the Lord appeareth to
Joseph in a dream, saying, Arise, and take the young child and his mother, and
flee into Egypt, and be thou there until I bring thee word: for Herod will seek
the young child to destroy him.
2:14 When he arose, he took the young child and his mother by night, and
departed into Egypt:
2:15 And was there until the death of Herod: that it might be fulfilled which
was spoken of the Lord by the prophet, saying, Out of Egypt have I called my
son.
2:16 Then Herod, when he saw that he was mocked of the wise men, was exceeding
wroth, and sent forth, and slew all the children that were in Bethlehem, and in
all the coasts thereof, from two years old and under, according to the time
which he had diligently inquired of the wise men.
2:17 Then was fulfilled that which was spoken by Jeremy the prophet, saying,
2:18 In Rama was there a voice heard, lamentation, and weeping, and great
mourning, Rachel weeping [for] her children, and would not be comforted, because
they are not.
For further study, read: