When did the star of Bethlehem appear relative to Christ’s birth and how long was it supposed to be visible?
Nobody truly knows the answer to this question. Scholars have been studying it for many years. What we can best understand is that when the star appears for the Magi to find Jesus, it is about two years after his birth.
This must mean that Jesus and his parents lived in Bethlehem for about two years. Contrary to almost every nativity scene you find, scholars say that the shepherds visited Jesus at his birth, but the Magi came later.
It could be that the star led the Magi to the place where Jesus was when they finally arrived, so it was not always over the place where Jesus and his parents lived. It only arrived there while leaving the Magi to his dwelling in Bethlehem.
In this way, it would be much like the pillar of fire by night and cloud by day that guided the Israelites through the wilderness. I’m not saying that the star was the same thing, but had the same function as these.
Scholars estimate that if these Magi came from the East, perhaps from Babylon where Daniel was captive in exile, it would’ve taken them two years to arrive in Bethlehem in Israel. I think this is where they get the idea of Jesus being two years old.
Is it possible scholars are wrong? Of course. We just aren’t given enough information in Scripture to make a definitive answer on this question. But scholars who study these things have spent much more time and I have to understand the mechanics of Jesus’ birth and the visit of the Magi.
One thing that is clear in some of Scripture is that events may be combined to save space on parchment or time in communicating the message the author wants us to realize. This happens a lot in the prophecies of the Old Testament. Images may be combined to make a point instead of being split up in visions.
Matthew may be combining the shepherds and Magi seeing Jesus at the same time because it is the same action. It also shows that from the least of these (shepherds) to the greatest of them (kings are Magi from the east) all witnessed the birth of the Messiah, the King of the universe.
Whether this all happened in one night or it happened over a two-year span, the important part that I believe Matthew is conveying to us is that Jesus received esteem from the lowest of society to the highest. He is the King born humbly but worshiped by the extremes of society that day at his birth.