Most scholars believe Jesus was approximately 2 years old when the wise men came. Several things point to this. Two verses, in particular, can be used to help in determining the answer.
“And they came with haste and found Mary and Joseph, and the Babe lying in a manger” (Luke 2:16).
“And when they had 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 gifts to Him: gold, frankincense, and myrrh” (Matthew 2:11).
In Luke, when Jesus was born and the shepherds come to see Him, He is called “the Babe”. In Matthew, when the wise men come to see Him, He is called “the young Child”. The two Greek words used are different and point to the fact that Jesus had aged slightly between the shepherds’ visit and the wise men's visit. In Luke 2:16, the word used for babe when the shepherds come is, brephos, meaning new-born child or infant; and in Matthew 2:16 the word used for young child when the wise men come is, paidion, meaning little boy/little girl, young child.
Also, in Matthew when the wise men arrive to see Jesus, it says that they came “into the house”. When Jesus was born, He was wrapped in swaddling clothes and laid in a manger. This manger was in a type of structure that we would call a stable. So, the family was no longer in the stable and had secured a home by the time the wise men arrived. And when you consider the time required for the wise men to observe the star, research its significance, travel several hundred miles, locate Mary, Joseph, and the child, and for Herod to issue his edict to kill all male children 2 years old and younger, we can reasonably deduce that Jesus was approximately 2 years old when the wise men arrived.