Extramarital sex was previously illegal in Christian countries too, but the laws are not usually enforced. It is still seen as a cultural taboo in many countries.

Judaism
The Torah prescribes the death penalty through stoning for adultery, which is defined as having sex with a woman, who is married to another man.

Christianity
Extramarital sex is considered to be immoral in many Christian denominations, who point to passages like 1 Corinthians 6:9–10:
"Do you not know that the unrighteous will not inherit the kingdom of God? Do not be deceived: neither the immoral, nor idolaters, nor adulterers, nor sexual perverts, nor thieves, nor the greedy, nor revilers, nor robbers will inherit the kingdom of God."