Taken from the Catechism of the Catholic Church
What happens when we die?
1021 Death puts an end to human life as the time open to either accepting or rejecting the divine grace manifested in Christ. The New Testament speaks of judgment primarily in its aspect of the final encounter with Christ in his second coming, but also repeatedly affirms that each will be rewarded immediately after death in accordance with his works and faith. The parable of the poor man Lazarus and the words of Christ on the cross to the good thief, as well as other New Testament texts speak of a final destiny of the soul -a destiny which can be different for some and for others.
1022 Each man receives his eternal retribution in his immortal soul at the very moment of his death, in a particular judgment that refers his life to Christ: either entrance into the blessedness of heaven-through a purification, or immediately, or immediate and everlasting damnation.
At the evening of life, we shall be judged on our love.
The Second Coming
1038 The resurrection of all the dead, "of both the just and the unjust," will precede the Last Judgment. This will be "the hour when all who are in the tombs will hear [the Son of man's] voice and come forth, those who have done good, to the resurrection of life, and those who have done evil, to the resurrection of judgment." Then Christ will come "in his glory, and all the angels with him .... Before him will be gathered all the nations, and he will separate them one from another as a shepherd separates the sheep from the goats, and he will place the sheep at his right hand, but the goats at the left.... and they will go away into eternal punishment, but the righteous into eternal life."