In Islam, the purpose of life is to live in a way that is pleasing to Allah so that one may gain Paradise.
The Muslim doctrine of salvation is that unbelievers (kuffar, literally "those who are ungrateful") and sinners will be condemned, but genuine repentance results in Allah's forgiveness and entrance into Paradise upon death.
Muslims believe that at puberty, an account of each person's deeds is opened. This will be used at the Day of Judgment to determine his eternal fate. The Quran also suggests a doctrine of divine predestination. (Qur'an 4:49, 24:21, 57:2)
Paradise and Hell
Paradise (firdaws), also called "The Garden" (Janna), is a place of physical and spiritual pleasure, with lofty mansions (Qur'an 39:20, 29:58-59), delicious food and drink (52:22, 52:19, 38:51), and virgin companions called houris (56:17-19, 52:24-25, 76:19, 56:35-38, 37:48-49, 38:52-54, 44:51-56, 52:20-21).
Hell, or Jahannam (Greek gehenna), is mentioned frequently in the Quran and the Sunnah using a variety of imagery.
Faith and Works for Salvation
The Quran teaches the necessity of both faith and good works for salvation:
He it is Who sends blessings on you, as do His angels, that He may bring you out from the depths of Darkness into Light: and He is Full of Mercy to the Believers. (33:43)
In the case of those who say, "Our Lord is Allah," and, further, stand straight and steadfast, the angels descend on them (from time to time): "Fear ye not!" (they suggest), "Nor grieve! but receive the Glad Tidings of the Garden (of Bliss), that which ye were promised!" (41:30)
And fear the Fire, which is prepared for those who reject Faith. (3:131)
It is not righteousness that ye turn your faces towards East or West; but it is righteousness to believe in Allah and the Last Day, and the Angels, and the Book, and the Messengers; to spend of your substance, out of love for Him, for your kin, for orphans, for the needy, for the wayfarer, for those who ask, and for the ransom of slaves; to be steadfast in prayer, and give zakat; to fulfill the contracts which ye have made; and to be firm and patient, in pain (or suffering) and adversity, and throughout all periods of panic. (2:177)
You be foremost (in seeking) forgiveness from your Lord, and a Garden (of Bliss), the width whereof is as the width of heaven and earth, prepared for those who believe in Allah and His messengers: that is the Grace of Allah, which He bestows on whom He pleases: and Allah is the Lord of Grace abounding.” (57:21)
Those are limits set by Allah. those who obey Allah and His Messenger will be admitted to Gardens with rivers flowing beneath, to abide therein (for ever) and that will be the supreme achievement. But those who disobey Allah and His Messenger and transgress His limits will be admitted to a Fire, to abide therein: And they shall have a humiliating punishment. (4:13-14)
To those who believe and do deeds of righteousness hath Allah promised forgiveness and a great reward. (5:9)
But those who believe and work righteousness,- no burden do We place on any soul, but that which it can bear, they will be Companions of the Garden, therein to dwell (forever). (7:42) As to those who believe and work righteousness, verily We shall not suffer to perish the reward of any who do a (single) righteous deed. (18:30)
But after them there followed a posterity who missed prayers and followed after lusts soon, then, will they face Destruction. Except those who repent and believe, and work righteousness: for these will enter the Garden and will not be wronged in the least. Gardens of Eternity, those which (Allah) Most Gracious has promised to His servants in the Unseen: for His promise must (necessarily) come to pass. (S. 19:59-61)