Is It Haram to Have a Girlfriend or a Boyfriend?
Question

I am deeply in love with a Muslim man and want to marry him. I know that Allah forbids girlfriend-boyfriend relationships, and feel very sorry in my heart for our relationship. I feel that because we have been in this relationship which is abhorred by Allah, he will never marry me because he has lost respect for me. What does the Quran say about having a girlfriend or a boyfriend?
Praise be to Allah.The Quran prohibits having girlfriends or boyfriends
Allah says (interpretation of the meaning):
“… Wed them with the permission of their own folk and give them their mahr (dowry) according to what is reasonable; they should be chaste, not adulterous, nor taking boyfriends…” [al-Nisa 4:25]
In his commentary on this ayah, Ibn Kathir (may Allah have mercy on him) said:
“Muhsanat [translated as “chaste”] means that they should be pure, not indulging in zina (unlawful sexual conduct), hence they are described as not being musafihat , which means promiscuous women who do not refuse anyone who wants to commit immoral acts with them. 
Regarding the phrase wa la muttakhidhati akhdan (‘nor taking boyfriends’), Ibn 'Abbas said: ‘al-musafihat means those who are known to commit zina, meaning those who will not refuse anyone who wants to commit immoral acts with them.’ Ibn 'Abbas also said: ‘muttakhidhati akhdan means lovers.’ A similar interpretation was narrated from Abu Hurayrah, Mujahid, al-Sha’bi, al-Dahhak, ‘Ata al-Khurasani, Yahya ibn Abi Kathir, Muqatil ibn Hayyan and al-Saddi. They said: (it means) lovers. Al-Hasan al-Basri said: ‘It means a (male) friend.’ Al-Dahhak also said: ‘wa la muttakhidhati akhdan also means a woman who has just one boyfriend or lover with whom she is happy. Allah has also forbidden this, meaning marrying her so long as she is in that situation…’”
Allah says (interpretation of the meaning):
“Made lawful to you this day are al-tayyibat [all kinds of halal (lawful) foods…]. The food of the People of the Scripture (Jews and Christians) is lawful to you and yours is lawful to them. (Lawful to you in marriage) are chaste women from the believers and chaste women from those who were given the Scripture (Jews and Christians) before your time, when you have given their due mahr (bridal money given by the husband to the wife at the time of marriage), desiring chastity (i.e., taking them in legal wedlock), not committing illegal sexual intercourse, nor taking them as girlfriends. And whosoever disbelieves in the Oneness of Allah and in all the other articles of Faith, then fruitless is his work, and in the Hereafter he will be among the losers.” [al-Maidah 5:5]
Ibn Kathir (may Allah have mercy on him) said:
“Muhsineen ghayr musafiheen wa la muttakhidhi akhdan (‘desiring chastity (i.e., taking them in legal wedlock), not committing illegal sexual intercourse, nor taking them as girlfriends’ ). Just as Allah imposed the condition of chastity on women, meaning that they refrain from zina, so it is also imposed on men. The man must also be pure and chaste. So they should be ghayr musafiheen, meaning they should not be adulterers who do not refrain from sin and do not refuse any who come to them (for immoral purposes). Nor should they be muttakhidhi akhdan, meaning those who have girlfriends or female lovers with whom they have an exclusive relationship, as quoted above from Surat al-Nisa. (The one with many lovers or the one with just one lover) are both the same. For this reason Imam Ahmad ibn Hanbal (may Allah have mercy on him) said that it is not right to marry a promiscuous woman unless she has repented, or to arrange a marriage of such a woman to a chaste man, so long as she is still conducting herself in this manner. Similarly, he (Ahmad) says that it is not right for a promiscuous man to marry a chaste woman unless he repents and gives up his immoral conduct, because of this ayah… We will discuss this matter in further detail after quoting the ayah (interpretation of the meaning):
“Let no man guilty of fornication or adultery marry any but a woman similarly guilty, or an unbeliever: nor let any but such a man or an unbeliever marry such a woman: to the believers such a thing is forbidden.” [al-Nur 24:3]
The Sunnah prohibits having girlfriends or boyfriends
Among the stories that show that it is forbidden to have girlfriends or to marry them is the story of Marthad ibn Abi Marthad, who used to smuggle Muslim prisoners-of-war from Makkah to Madinah. There was a prostitute in Makkah, called ‘Anaq, who had been a friend of Marthad’s. Marthad had promised to take one of the prisoners from Makkah to Madinah. He said: “I came to the shade of one of the gardens of Makkah on a moonlit night, then ‘Anaq came and saw my shadow by the garden. When she reached me, she recognized me and said: ‘Marthad?’ I said, ‘Marthad.’ She said: ‘Welcome! Stay with us tonight.’ I said, ‘O ‘Anaq, Allah has forbidden zina (unlawful sexual relations)’ … I came to the Messenger of Allah (peace and blessings of Allah be upon him) and asked him, ‘O Messenger of Allah, should I marry ‘Anaq?’ The Messenger of Allah (peace and blessings of Allah be upon him) remained silent and did not answer me at all, until the ayah ‘Let no man guilty of adultery or fornication marry any but a woman similarly guilty, or an unbeliever; nor let any but such a man or an unbeliever marry such a woman; to the believers such a thing is forbidden’ [al-Nur 24:3 – Yusuf ‘Ali’s translation] was revealed. Then the Messenger of Allah (peace and blessings of Allah be upon him) said: ‘O Marthad, Let no man guilty of adultery or fornication marry any but a woman similarly guilty, or an unbeliever; nor let any but such a man or an unbeliever marry such a woman, so do not marry her.’” (Reported by al-Tirmidhi, 3101; he said: it is a hasan gharib hadith).
‘Abd-Allah ibn Mughaffal reported that there was a woman who had been a prostitute during the days of ignorance (before Islam). A man passed by her, or she passed by him, and he touched her. She said: “Stop it! (Mah! A word connoting a rebuke or denunciation). Allah has done away with shirk and had brought Islam.” So he left her alone and went away, still looking at her, until he walked into a wall, hitting his face. He came to the Prophet (peace and blessings of Allah be upon him) and told him what had happened. The Prophet (peace and blessings of Allah be upon him) said: “You are a man for whom Allah wishes good. When Allah, may He be blessed and exalted, wishes good for His slave, He hastens the punishment for his sin, so that it is dealt with before the Day of Resurrection.” (Reported by al-Hakim, 1/349, who said this hadith is sahih according to the conditions of Muslim, and al-Dhahabi agreed with him. See Sahih al-Jami’, 308).
The ruling of having girlfriends and boyfriends in Islam
These ayat and ahadith clearly indicate that it is haram (forbidden) for men to have any kind of friendship or relationship with non-mahram women (women to whom they are not closely-related and to whom they could get married). 
The evil consequences and misery caused by such relationships are obvious to anyone who observes real life. A similar question has been asked under #2085 . 
We ask Allah to keep us far away from that which is forbidden, to protect us from all that may earn His wrath and to keep us safe from a painful punishment. May Allah bless our Prophet Muhammad.
And Allah knows best.