Sexual relations when a woman is a nidda – from the time when her period begins until she goes to the mikveh after it is over – is forbidden. Transgressing that negative commandment carries with it the punishment of karet – the people will be “cut off” from the community. The Mishna (14b) discusses the case of someone who transgresses a positive commandment of nidda, and explains that the positive commandment is when a couple is engaged in permissible intercourse, and the woman suddenly realizes that she has become a nidda. When she informs the man of her status, his obligation is to remain in place until his erection is lost in order to avoid sexual pleasure with a nidda.
This parallels the case of the individual who enters the Temple and becomes tameh while he is there, since in both cases the entry was permissible, and the problem developed at a later time. The difference is that in the Temple, the man who became ritually defiled must leave as quickly as possible, while in the case of the nidda the recommendation is to wait until it is appropriate to leave.
Following this discussion, the Gemara on today’s daf brings a baraita that quotes Rabbi Yoshiya as teaching that the passage in Sefer Vayikra (15:31) warns husbands to refrain from intimacy with their wives when their period approaches. In other words, it is essential for a woman to track her period so that the couple will know when to anticipate its arrival and avoid intimacy for a half day prior to that time.
Most of the rishonim do not believe that Rabbi Yoshiya’s teaching is a biblical law, rather it is a rabbinic ordinance that was attached to a passage in the Torah. Others suggest that the biblical law would forbid intimacy only at the time that the period was expected, and the rabbinic addition is to extend that time by half a day. It should be noted that this rule limiting intimacy before the expected period refers only to sexual relations; other interactions between husband and wife remain permitted.