Praise be to Allah.
For a man to form an illicit relationship with a non-mahram woman is not just cheating on his wife, it is also a sin and an act of disobedience towards his Lord. Allaah has forbidden such relationships and has barred the ways that may lead to the greater form of immorality which is zina (unlawful sexual relationships), which is what is referred to in the question.
The forbidden acts which people commit when they have such relationships are many and include being alone with that person (khulwah), shaking hands with them, looking at them, etc. These are sins which are forbidden in the texts in and of themselves, and because of the sin of zina to which they may lead.
For a Muslim woman to form an illicit relationship with a man who is not her mahram – whether he is married or not – is also a major sin and is worse than what is mentioned in the first part of the question, because it results in mixing of lineages and it makes the husband doubt whether his children are really his or not, which leads to a great deal of mischief.
There follow the fatwas of some of the scholars concerning something that is less serious than meetings between the sexes, so what about things that are more serious?
1 – Shaykh Ibn ‘Uthaymeen said:
It is not permissible for any person to correspond with a woman who is not his mahram, because of the fitnah (temptation) involved in that. The person who is sending these letters may think that there is no fitnah involved, but the Shaytaan will keep at him until he tempts the man by means of the woman and vice versa.
The Prophet (peace and blessings of Allaah be upon him) commanded those who hear the Dajjaal to keep away from him, and he said that a man may come to him as a believer, but the Dajjaal will keep at him until he tempts him and leads him astray.
There is a great deal of temptation and danger in correspondence between young men and young women, so they must keep away from it, even though the questioner may say that there is no love involved.
Fataawa al-Mar’ah al-Muslimah, 2/578
2 – Shaykh ‘Abd-Allaah al-Jibreen said, when he was asked about corresponding with a non-mahram woman:
This action is not permissible, because it will provoke desire between them and will make them want to meet one another. This kind of correspondence often causes fitnah (temptation) and plants the seeds of zina in the heart, which leads to evil actions. So we advise those who are seeking that which is in their own best interests and who wish to protect themselves to avoid writing to or speaking with non-mahrams, etc., so as to protect their religious commitment and their honour, and Allaah is the Source of help.
Fataawa al-Mar’ah al-Muslimah, 2/578, 579
And Allaah knows best.