This commandment comes from the Old Testament, Exodus 20:14, but has been the subject of much debate in both Judaism and Christianity, as the passage is not defined as what exactly it means.
Christian churches deem adultery as sexual relations where one of the persons engaging in the sexual activity is married to a third person. This interpretation is often based on Genesis 2:24, which says, "Therefore a man leaves his father and his mother and cleaves to his wife, and they become one flesh."
In the Proverbs, adultery is described as something done by someone who lacks sense.
"...he who does it destroys himself. He will get wounds and dishonor, and his disgrace will not be wiped away. For jealousy makes a man furious, and he will not spare when he takes revenge. He will accept no compensation; he will refuse though you multiply gifts."
Jesus takes the concept of adultery even further, saying...
"But I say to you, anyone who looks on a woman to lust after her has committed adultery with her already in his heart." - Matthew 5:28