If a person commits a sin for which he deserves to be cursed, can he repent? Is it possible for Allah to forgive him?
Question

                I was wondering what does it mean to be cursed by Allah as in is it a realm were a person is and it has sight,test,and touch to it were if a person is cursed that means that Allah puts a person in a world that is crazy and inane and hurts him and talks to him,our is it just a simple curse were its only a saying and thats all.
also i want to know if a person is cursed by Allah does that mean that he cant make it to heaven our be forgiving by Allah because he/she is cursed.
also i have a friend that lived an OK Muslim life he started fasting at 10 and stopped at 15 because he started hanging out with unbeliever that smoked weed and he later even had a beer,and later when he was in another town he smoked weed again,and later in the same town he got in a relationship with an unbeliever and had sex committing fornication/zina the relationahip lasted around 6mounths before he cut it off because his sister and mother told him that it was haram and evil so he said that he could not do it any more so he left and also left a gang life..i was wondering can this be forgiving by Allah and whats the punishment if not eternal.
also the same person started hearing voices and they said they were souls and start talking to Allah and Allah told him that he will be forgiving but sometimes the voice of Allah says he wont be forgiven and he see stuff that's other people don't is he cursed and if he is in this world that he is in can he be forgiven.
Praise be to Allah.Firstly: 
Being cursed means being cast far away from goodness. And it was said that being cursed by Allah means being cast far away from Him, and being cursed by people means being reviled and prayed against by them. Everyone whom Allah has cursed is far away from His mercy and deserves punishment, so he is doomed. 
End quote from Lisaan al-‘Arab, 13/387-388 
The one who is cursed is either a kaafir, who is cast far away from the mercy of Allah, to the punishment of Allah, or he is a Muslim but he did an action for which he deserves to be cursed, such as drinking alcohol, consuming riba (usury), reviling his parents and other grave sins. This cursing only results from major sins, but that does not mean that he will abide in Hell for eternity, because if one who believes in Tawheed dies believing in Tawheed and as a Muslim, even if he enters Hell for sins he committed, he will not remain there for eternity. This is the view of Ahl as-Sunnah wa’l-Jamaa‘ah. 
Ibn ‘Uthaymeen (may Allah have mercy on him) said: 
Being cursed means being cast far away from the mercy of Allah; there is no curse for doing any action except major sins. Hence the scholars said: everything for which the punishment is being cursed is a major sin. 
End quote from Duroos wa Fataawa al-Haram al-Madani, p. 57 
If a person does an action which constitutes kufr and he dies in that state without having repented from it, then he is cursed in the sense that he has incurred the eternal punishment of Allah from which he will never be brought forth. 
But if a person was a Muslim and committed a serious action which incurred the wrath or curse of Allah, he is not regarded as having gone beyond the pale of Islam because of committing that major sin or because Allah has deemed him to be cursed. He is subject to the will of Allah, may He be exalted: if He wills He will punish him as he deserves for his action, or if He wills He will forgive him by His grace and kindness. But if He punishes him, He will punish him to whatever extent He wills, then He will bring him forth from that punishment. This person is not subject to eternal punishment. 
There is no doubt that drinking alcohol, smoking weed (marijuana) and committing zina (fornication) are major sins that incur the wrath and the punishment of Allah. But if a person does any of these things then repents, Allah will accept his repentance on condition that he is sincere in his regret and his repentance, he gives up his sin and continues to seek forgiveness and turn to Allah. Allah, may He be exalted, says (interpretation of the meaning):
“Then, there has succeeded them a posterity who have given up As-Salat (the prayers) (i.e. made their Salat (prayers) to be lost, either by not offering them or by not offering them perfectly or by not offering them in their proper fixed times, etc.) and have followed lusts. So they will be thrown in Hell.
Except those who repent and believe (in the Oneness of Allah and His Messenger Muhammad ), and work righteousness. Such will enter Paradise and they will not be wronged in aught”
[Maryam 19:59-60]
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse __ and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful
71. And whosoever repents and does righteous good deeds; then verily, he repents towards Allaah with true repentance”
[al-Furqaan 25:68-70]
Secondly: 
The curse of Allah upon those of His slaves who deserve it means His diverting that person away from the path of true guidance towards the path of misguidance and evil, or His uttering what this person deserves of a curse and mentioning this person by way of cursing him. 
This curse has nothing to do with a sign or symbol that appears on a person or that appears to him, such as something coming down to him from the sky that is indicative of this curse, or something appearing in his form or image, or his seeing something that is indicative of this curse, and other such illusions. It also has nothing to do with any kind of insanity or leprosy or other kind of illness befalling him. The curse is a shar‘i ruling that has to do with the person’s religious commitment in this world and his fate with his Lord in the Hereafter. It may seem to you that a person is living the most luxurious life and the finest life in terms of outward appearances, but he is cursed before Allah and cast out from His mercy. And it may seem to you that a person has the lowest standing among the people and the hardest life; he may seem to be the unluckiest or the most unkempt in outward appearance, but before Allah he is one of those who are saved and victorious, upon whom mercy is bestowed. 
Thirdly: 
What your friend sees of things that no one else sees, and what he hears of voices that he says are souls, and that which comes to him and tell him that he is Allah and will forgive him or will never forgive him – all of that and similar things are tricks that the Shaytaan is playing on him to gain power over him and to take him further away from Allah. All of that comes under the heading of falsehood to which there is no reality and which in fact has no effect on the one whom Allah enables to repent and come back to his Lord. 
As for the voice of Allah, no human being can hear it in this world except the Prophets, and there is no Prophet after our Prophet Muhammad (blessings and peace of Allah be upon him). Similarly, no one can see his Lord until he dies, and we will see Him in the Hereafter. We ask Allah to grant us the blessing of gazing upon His noble Countenance. 
All that your friend has to do now is repent sincerely to Allah, may He be exalted, and give up these sins that his accursed enemy has caused him to fall into; he should regret what he has done in the past and hasten to make the most of the present by obeying Allah, doing a lot of good deeds, turning to Allah, thinking positively of Him, pinning his hopes on Him and seeking that which is with Him. Allah, may He be exalted, says (interpretation of the meaning):
“Say: O ‘Ibaadi (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allaah, verily, Allaah forgives all sins. Truly, He is Oft‑Forgiving, Most Merciful”
[al-Zumar 39:53]
Ibn Maajah (4250) narrated that Ibn Mas‘ood (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The one who repents from sin is like one who did not sin.”
Classed as saheeh by al-Albaani in  Saheeh Ibn Maajah
As-Sindi (may Allah have mercy on him) said: 
“The one who repents from sin” is general in meaning and includes all sins. So the hadeeth indicates that repentance will be accepted, no matter what the sin was. The apparent meaning of the hadeeth indicates that repentance, if it is correct and fulfils necessary conditions, will be accepted.
End quote from Haashiyat as-Sindi ‘ala Sunan Ibn Maajah, 2/562 
Shaykh al-Islam (may Allah have mercy on him) said: 
Sins detract from faith, but if a person repents Allah will love him and he will rise in status by virtue of his repentance. If it is decreed that he should repent, he will be as Sa‘eed ibn Jubayr said: A person may do good deeds and enter Hell thereby and a person may do bad deeds and enter Paradise thereby. That is because he may do good deeds then be impressed with them, which may lead to him becoming lax and developing self admiration, or he may do bad deeds and then never forget that, so he asks Allah for forgiveness and repents to Him from that. 
It is proven in as-Saheeh that the Prophet (blessings and peace of Allah be upon him) said: “Deeds are to be judged by the way they end.” If the believer does an evil deed, the punishment for that may be warded off in ten ways: if he repents and his repentance is accepted by Allah, for the one who repents is like the one who did not sin; if he prays for forgiveness and is forgiven; if he does good deeds that erase his bad deeds, because good deeds erase bad deeds; if his believing brothers pray for him and ask for forgiveness for him, whether he is alive or dead; if they give him the reward of their good deeds by means of which Allah benefits him; if his Prophet Muhammad (blessings and peace of Allah be upon him) intercedes for him; if Allah tests him by putting him through calamities that expiate his sin; or if He tests him in al-Barzakh with swooning that expiates his sin; or if He tests him through the stages and terrors of the Day of Resurrection which will expiate his sin; or if the Most Merciful of those who show mercy has mercy on him. 
If he misses all of these ten, he has no one to blame but himself. 
End quote from Majmoo‘ al-Fataawa, 10/45-46 
Ibn al-Qayyim (may Allah have mercy on him) said: 
The wisdom of Allah, which is based on justice and grace, dictates that the one who repents from sin is like the one who did not sin. Allah, may He be glorified, has guaranteed the one who repents from shirk, murder and zina that he will replace his bad deeds with good deeds. This is a general ruling that applies to everyone who repents from sin. Allah, may He be exalted, says (interpretation of the meaning):
“Say: O ‘Ibaadi (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allaah, verily, Allaah forgives all sins. Truly, He is Oft‑Forgiving, Most Merciful”
[al-Zumar 39:53].
No sin is excluded from this general meaning, but this applies only to those who repent.
End quote from al-Jawaab al-Kaafi, 1/116 
So give your friend the glad tidings of the vastness of Allah’s mercy, His great forgiveness, His joy at the repentance of His slave and when His slave turns to Him. Let him hasten to repent and come back to Allah, and to give up these bad companions and seek the company of righteous people. 
For more information please see the answer to question no. 9222, 36674, 46683 
And Allah knows best.