Matthew 1:24-25 (NRSV) . . . Joseph . . . took her as his wife,  but had no marital relations with her [RSV: “knew her not”] until she had borne a son . . .
This would involve probably six months, bare minimum. We don’t know at what stage he was aware that she was pregnant. All we know is that it was after they were “betrothed” (Mt 1:18). The word “until” does not necessarily imply that Mary and Joseph had sex after Jesus was born, as is often argued. Even Calvin and Luther agree with the Catholic view of perpetual virginity and vigorously defend it. John Calvin wrote about the use of “until” in Matthew 1:25:
[On Matt 1:25:] The inference he [Helvidius] drew from it was, that Mary remained a virgin no longer than till her first birth, and that afterwards she had other children by her husband . . . No just and well-grounded inference can be drawn from these words . . . as to what took place after the birth of Christ. He is called ‘first-born’; but it is for the sole purpose of informing us that he was born of a virgin . . . What took place afterwards the historian does not inform us . . . No man will obstinately keep up the argument, except from an extreme fondness for disputation. (Calvin’s Commentaries, translated by William Pringle, Grand Rapids, Michigan: Eerdmans, 1949, vol. I, 107)
Likewise, Martin Luther stated:
When Matthew [1:25] says that Joseph did not know Mary carnally until she had brought forth her son, it does not follow that he knew her subsequently; on the contrary, it means that he never did know her . . . This babble . . . is without justification . . . he has neither noticed nor paid any attention to either Scripture or the common idiom. (Luther’s Works, vol. 45:206, 212-213 / That Jesus Christ was Born a Jew  )
Scott Hahn, in his Ignatius Catholic Study Bible comments on the passage:
This conjunction is often used (translated “to” or “till”) to indicate a select period of time, without implying change in the future (2 Sam 6:23 [LXX]; Jn 9:18; 1 Tim 4:13).
But that is a side issue in relation to our present consideration (a “footnote diversion” if you will). Protestants who reject the perpetual virginity of Mary need to be asked why Joseph abstained for the entire pregnancy if in fact he had marital relations with the Blessed Virgin Mary after Jesus’ birth.
Rabbinic Judaism did not forbid sexual relations during the whole of pregnancy (especially not the final three months). I think we can safely assume that something of that sort was the custom of the Jews of Jesus’ time. So why did Joseph do this? There is no plausible reason to do so, other than the fact that he intended to never have relations with her (she being the Mother of God). Sometimes the most effective and elegant arguments are the small ones like this (that one could almost not notice at all).
Writing against Helvidius, St. Jerome provocatively asked (making precisely the present argument):
Why then did Joseph abstain at all up to the day of birth? He will surely answer, Because of the Angel’s words, “That which is born in her, &c.” He then who gave so much heed to a vision as not to dare to touch his wife, would he, after he had heard the shepherds, seen the Magi, and known so many miracles, dare to approach the temple of God, the seat of the Holy Ghost, the Mother of his Lord?
In conclusion, Jason Evert offers some great insights in an article for Catholic Answers Magazine (then called This Rock): 1 July 2000:
[E]ven in the Old Testament God asked married couples to refrain from intercourse for various reasons. For example, the priests of the temple had to refrain from intimacy with their wives during the time of their service. Likewise, Moses had the Israelites abstain from intercourse as he ascended Mount Sinai (Ex. 20:15 [Dave: should be 19:15]). There is a theme here of refraining from marital rights because of the presence of something very holy.
The Church Fathers knew that there was something greater than the temple in Mary’s womb, comparing it to the Eastern Gate mentioned in Ezekiel 44: “This gate shall remain shut; it shall not be opened, and no one shall enter by it; for the Lord, the God of Israel, has entered by it; therefore it shall remain shut.” Mary had become the dwelling place of the Almighty, like the Ark of the Covenant in the Old Testament. Now, if Uzzah was struck dead for touching the Ark (2 Sam. 6:6–8), should it be surprising that Joseph understood that Mary was a vessel consecrated to God alone? The idea that Joseph assumed normal marital relations with Mary after the birth of Christ was an irreverence that even the Protestant reformers rejected. . . .
[T]he angel told him to lead her into the house as a wife (paralambano gunaika), but the language that describes marital relations is not used here. It was used, however, in Luke 1:35: “The Holy Spirit will come upon you, and the power of the Most High will overshadow you.” To “overshadow” a woman was a euphemism for having a marital relationship, as was the phrase “to lay one’s power” over a woman. The Holy Spirit had espoused Mary, and she had been consecrated, set apart for God.
(originally 4-3-20 on Facebook; greatly expanded on 6-17-20)
Photo credit: The Annunciation (1644), by Philippe de Champaigne (1602-1674) [public domain / Wikimedia Commons]