Here is the Quranic answer.
After death, on an appointed day we all will be resurrected, we will face the Day of Judgment. On this day all, the people who were born on this Earth will be gathered before Allah. He will judge them by their deeds on this Earth.
The main point emphasized in the Qur’an is that, in order to serve justice to all the creatures, the day of Judgement will surely take place at the appointed hour, and that every person will be rewarded for his/her good deeds or punished for his/her bad deeds. Also, the accounts between individuals will also be settled this day; any person who committed injustice caused damage or sufferings to others will pay this day to victims. This fact is a significant factor for keeping people’s behavior in check.
Allah will ask us on this Day of Judgment, “How much have you lived in the world?” Our answer will be, “A part of a day”. This proves beyond an iota of doubt that our life on this earth is very short vis-à-vis the life in the Hereafter.
Quranic verses on Day of Judgment.
“In the name of Allah, the Entirely Merciful, the Especially Merciful. [All] praise is [due] to Allah, Lord of the worlds – The Entirely Merciful, the Especially Merciful, Sovereign of the Day of Recompense.” (1:1-4)
“And what can make you know what is the Day of Recompense? Then, what can make you know what is the Day of Recompense? It is the Day when a soul will not possess for another soul [power to do] a thing; and the command, that Day, is [entirely] with Allah.” (82:17-19)
“When we have died and become dust and bones, are we indeed to be resurrected? And our forefathers [as well]?” Say, “Yes, and you will be [rendered] contemptible.” It will be only one shout, and at once they will be observing. They will say, “O woe to us! This is the Day of Recompense.” [They will be told], “This is the Day of Judgement which you used to deny.”” (37:16-21)
The Striking Calamity – What is the Striking Calamity? And what can make you know what is the Striking Calamity? It is the Day when people will be like moths, dispersed, And the mountains will be like wool, fluffed up. Then as for one whose scales are heavy [with good deeds], He will be in a pleasant life. But as for one whose scales are light, His refuge will be an abyss. And what can make you know what that is? It is a Fire, intensely hot. 101:10:11
Further Qur’anic verses on the topic:
7:51, 7:87, 11:103-108, 16:27, 16:77, 17:13, 17:97-989, 19:37-39, 19-95, 20:124, 21:47, 26:82, 38:78, 51:12, 56:56, 70;26, 74:46, 77:8-14, 82:14-15, 83;11-10
This is the ultimate goal of every believer in any religion. The Qur’an puts the basic condition for salvation as believing and worshiping Allah without ascribing partners or associates to Him. After fulfilling this condition, if a person does righteous things and pleases Allah, they will attain salvation, by the bountiful mercy of Allah. Any believing person who has sinned but repented during his lifetime can hope for His mercy and salvation. The Qur’an exhorts each living person to work diligently to attain salvation.
“Allah has promised those who believe and do righteous deeds [that] for them there is forgiveness and great reward.” (5:9)
“Race toward forgiveness from your Lord and a Garden whose width is like the width of the heavens and earth, prepared for those who believed in Allah and His messengers. That is the bounty of Allah which He gives to whom He wills, and Allah is the possessor of great bounty.” (57:21)
“And hasten to forgiveness from your Lord and a garden as wide as the heavens and earth, prepared for the righteous.” (3:133)
“Those – their reward is forgiveness from their Lord and gardens beneath which rivers flow [in Paradise], wherein they will abide eternally; and excellent is the reward of the [righteous] workers.” (3:136)