"You shall not covet your neighbor's wife" is the Ninth Commandment as mentioned in the Catechism of the Catholic Church. It is quoted as Exodus 20:17.
The meaning of "You shall not covet your neighbor's wife" is that one should not even think about another man's wife with lust in his heart. This is reinforced as "Anyone who looks at a woman lustfully has already committed adultery with her already in his heart" - Mt 5:28. Purifying one's heart is important, as stated by the evangelist Matthew in Matt. 15:19, "from the heart come evil thoughts, murder, adultery, fornication." Matthew also mentioned how "Blessed are the pure in heart for they shall see God."