Since Joseph and Mary had their home away from Bethlehem and had to travel to Bethlehem for the census and since the wise men came when they were in a house but the house was in Bethlehem it seems likely that it was not very long after the birth of the Lord. Maybe a few weeks.
According to scripture, Lord Jesus was a young child when the wise men arrived at Bethlehem.
Matthew 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.
And Herod killed all the boy children 2 years old and younger.
Matthew 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.
January 6th veralls:
No january 12th I heard, 2 years later, epiphany day. I had never heard of it. One explanation said Herod inquired from the wise men so he was 2 years old. Could be but not really convincing. If He was 2 I think to be sure Herod would have killed them 3 and under that. That pharao did that too. Wasn't Moses a few months? Oh well. I won't crash the party.
It's unlikely that Blessed Mary and saint Joseph stayed in Bethlehem for two years after the birth of the Lord.
and I always thought they bought a house from the gold they got from the wise man.
Not very likely is it? Besides the Holy Family fled for Egypt as soon as the wise men visited so there was no time to go house shopping with the gold from the wise men.