actually why_islam, the Quran states that there are certain "sins" Allah will not forgive.
Verily, Allah does not forgive the ascribing of divinity to aught beside Him, although He forgives any lesser sin unto whomever He wills: for those who ascribe divinity to aught beside Allah have indeed gone far astray. 4:48
Behold, as for those who come to believe, and then deny the truth, and again come to believe, and again deny the truth, and thereafter grow stubborn in their denial of the truth- Allah will not forgive them, nor will He guide them in any way. 4:137
whether you [Mohammad] pray [to Allah] that they be forgiven or not- if you were to pray seventy times that they be forgiven, Allah will not forgive them, seeing that they are bent on denying Allah and His Apostle. And Allah does not bestow His guidance upon such iniquitous folk. 9:80
in other words, Allah does not forgive apostates, those who deny the validity of Mohammad's prophethood, or those who ascribe divinity to anything besides Allah. forgiveness comes about when the person doing / believing such things "repents" and becomes a Muslim. should one die while denying Islam, worshipping things other than Allah, or as an apostate from Islam, it is uncertain whether Allah would spare them from hell.
also, it is interesting to compare 9:80 of the Quran to Jesus of Nazareth's words on forgiveness -
Then Peter came to Jesus and asked, "Lord, how many times shall I forgive my brother when he sins against me? Up to seven times?" Jesus answered, "I tell you, not seven times, but seventy-seven times. (Matthew 18:21-22)
i overheard a kind of alarming and troubling conversation between an Islamic teacher and a small child... the teacher was teaching the children about jannah (paradise) and jahannam (hell fire) and was reminding them that if they did not love Allah and practice Islam, they would go to jahannam, and reminded them that no one knows their fate after death. one small boy said cheerfully "i always go to jannah!" and his teacher gasped and asked "how do you know? how do you know you will not go to the fire?" the kid got very quiet and bowed his head.
it amazed me that after a lifetime of faithfully eating halal, doing salah, giving zakah, after going on hajj and doing his best to live a Muslim life, this kid still had to live in fear of, perhaps, not being good enough for his god to truly love and pardon him. it opened my eyes to the great chasm between the Muslim and the heart / will of Allah, and the great uncertainty regarding the Islamic afterlife.