In the Holy Quran, Allah Ta'ala has ordered us to stay away from both adultery and things, which lead to adultery. As given in Surah Noor-
Direct the believing men to keep their eyes always lowered and guard their private parts. That is purer for them. Surely Allah is Well Aware of the (works) which they are busy doing. Surah Noor (24:30)
There is a Hadith in Musnad Imam Ahmed bin Hambal:
Translation of Hadith: It has been narrated on the authority of Hadhrat Abu Hurairah (May Allah be well pleased with him) that the Holy Prophet (Sallallahu alaihi wa sallam) has said: Every part of the body plays its part in adultery. Eyes fornicate and their fornication is seeing. Hands fornicate and their fornication is holding and grasping. Feet fornicate and their fornication is to walk (towards adultery). Mouth fornicates and its fornication is to kiss. The heart desires and the private parts endorse it by fornicating or belies it and stays away from adultery. (Musnad Iman Ahmed bin Hambal, Hadith No. 8572)
There is a Hadith in Mo'jam Kabeer Tabarani and Kanz Ul Ummal:
Translation of Hadith: Hadhrat Ma'aqal (May Allah be well pleased with him) narrates that the Holy Prophet (Sallallahu alaihi wa sallam) said: That a needle of iron should prick your head is better than that you touch a non-Mahram woman. (Mo'jam Kabeer Tabarani, Hadith No. 16880; Kanz Ul Ummal, Hadith No. 13065).
There is a Hadith in Mo'jam Kabeer Tabarani, Jame' Ul Ahadith, Kanz Ul Ummal:
Translation of Hadith: It has been narrated on the authority of Hadhrat Abu Umama (May Allah be well pleased with him) that the Holy Prophet (Sallallahu alaihi wa sallam) said: You surely keep your gaze down and guard your private parts otherwise Allah Ta'ala will change your faces. (Mo'jam Kabeer Tabarani, Hadith No. 7746; Jame' Ul Ahadith, Hadith No. 18309; Kanz Ul Ummal Hadith No. 13082)
The Holy Prophet (Sallallahu alaihi wa sallam) said:
Translation of Hadith: Whoever looks at the beauty of a woman with desire, on the Day of Judgment, molten lead will be poured into his eyes. (Al Hidayah, Kitab Ul Karahiyya, Vol. 4, Pg. No. 458)
It is strictly forbidden to touch or caress a non-Mahram. The Hadith have warnings about it. There is a Hadith about in Al Hidayah:
Translation of Hadith: Whoever touches the hand of a non-Mahram woman, on the Day of Judgment, an ember will be placed on his hand. (Al Hidayah, Kitab Ul Karahiyya, Vol. 4, Pg. No. 459)