CCC 1038 The resurrection of all the dead, “of both the just and the unjust,”1 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.”2 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.”3

1 Acts 24:15.
2 Jn 5:28-29.
3 Mt 25:31, 32, 46.