Assuming that the Annunciation and the Incarnation took place about the vernal equinox, Mary left Nazareth at the end of March and went over the mountains to Hebron, south of Jerusalem, to visit her cousin Elizabeth, because her presence and much more the presence of the Divine Child in her womb, according to the will of God, was to be the source of very great graces to John, Christ's Forerunner.
The event is related in Luke 1:39-57. Feeling the presence of his Divine Savior, John, upon the arrival of Mary, leaped within the womb of his mother Elizabeth; he was then filled with the grace of God.
St. Joseph may have accompanied Mary, returned to Nazareth, and when, after three months, he came again to Hebron to take his wife home, the apparition of the angel, mentioned in Matthew 1:19-25, may have taken place to end the tormenting doubts of Joseph regarding Mary's maternity.