بسم الله الرحمن الرحيم
According to Shariah, it is lawful to have intercourse with pregnant wife no matter in what stage of pregnancy she is. However, medically it could be harmful to have intercourse before the fourth month and after seventh month of pregnancy, hence one should avoid.
Allah knows Best!
Darul Uloom Deoband
This answer was collected from the official ifta website of Darul Uloom Deoband in India.