Here is the only explicit mention in the Gospels of what Jesus says about judgment and salvation in an afterlife. Note that this passage, the key to salvation is action, not belief. Jesus says:
“When the Son of man comes in his glory, and all the holy angels with him, then he will sit upon the throne of his glory, and before him will gather all nations. He will separate them one from another, just as a shepherd divides his sheep from the goats.
He will set the sheep on his right hand, but the goats on the left. Then the King will say to those on his right hand, ‘Come, you blessed of my Father, inherit the kingdom prepared for you from the foundation of the world. For I was a hungry and you gave me food; I was thirsty and you gave me drink; I was a stranger, and you took me in; naked and you clothed me; I was sick and you visited me; I was in prison and you came to me.’
Then the righteous will answer saying, “Master, when did we see you hungry and fed you? Or thirsty and gave you drink? When did we see you stranger and took you in? or naked and clothed you? Or when did we see you sick, or in prison, and came to you?’
The King will answer, ‘Truly I tell you, inasmuch as you have done it to one of the least of these my sisters and brothers, you have done it to me.’
Then he will also say to those on his left hand, “Get away from me, you cursed, into everlasting fire prepared for the devil and his angels. For I was a hungry and you gave me no food; I was thirsty and you gave me no drink; I was a stranger, and you did not take me in; naked and you did not clothe me; sick, in prison, and you did not visit me.’
Then they will say, “Master, when did we see you hungry or thirsty or a stranger or naked or sick or in prison, and did not minister to you?’
The master will answer, “Truly I tell you, inasmuch as you did it not to one of the least of these, you did it not to me.’ Thus these will go away into everlasting punishment, but the righteous into eternal life.”