When speaking of Christ's teaching about "the sheep and the goats," Lewis is referring to Matthew 25:31-46, in which Christ taught His disciples about the Last Judgment. (See also the Bookmark for page 51.)
"When the Son of Man [Jesus Christ] comes in his glory, and all the angels with him, then he will sit on his glorious throne. Before him will be gathered all the nations, and he will separate people one from another as a shepherd separates the sheep from the goats. And he will place the sheep on his right, but the goats on the left. Then the King will say to those on his right, 'Come, you who are blessed by my Father, inherit the kingdom prepared for you from the foundation of the world. For I was hungry and you gave me food, I was thirsty and you gave me drink, I was a stranger and you welcomed me, I was 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 him, saying, 'Lord, when did we see you hungry and feed you, or thirsty and give you drink? And when did we see you a stranger and welcome you, or naked and clothe you? And when did we see you sick or in prison and visit you?' And the King will answer them, 'Truly, I say to you, as you did it to one of the least of these my brothers, you did it to me.'
"Then he will say to those on his left, 'Depart from me, you cursed, into the eternal fire prepared for the devil and his angels. For I was hungry and you gave me no food, I was thirsty and you gave me no drink, I was a stranger and you did not welcome me, naked and you did not clothe me, sick and in prison and you did not visit me.' Then they also will answer, saying, 'Lord, when did we see you hungry or thirsty or a stranger or naked or sick or in prison, and did not minister to you?' Then he will answer them, saying, 'Truly, I say to you, as you did not do it to one of the least of these, you did not do it to me.' And these will go away into eternal punishment, but the righteous into eternal life."