The Sheep and the Goats or "The Judgment of the Nations" was a discourse of Jesus recorded in the New Testament. It is sometimes characterized as a Parable, although unlike most parables it does not purport to relate a story of events happening to other characters.
One theory is that it tells of the judgment, see also Last Judgment, and division of all the world's people into the blessed, who are welcomed by the Father, and the cursed, who are cast out. The division is entirely based on the acts of kindness and mercy done by people to their disadvantaged fellow men; Jesus identifies such kindness with kindness towards himself.
An alternative interpretation, one found by Calvinist theologian John Gill, is that the disadvantaged men spoken of are actually fellow Christians. And so instead of the division between blessed and cursed being on good works it is based on ones response to the people and message of Christ's Church.
The text of the passage appears in Matthew's Gospel, and is the final portion of a section containing a series of parables. From Matthew 25:31–46 (WEB):
31"But when the Son of Man comes in his glory, and all the holy angels with him, then he will sit on the throne of his glory. 32Before him all the nations will be gathered, and he will separate them one from another, as a shepherd separates the sheep from the goats. 33He will set the sheep on his right hand, but the goats on the left. 34Then the King will tell those on his right hand, 'Come, blessed of my Father, inherit the Kingdom prepared for you from the foundation of the world; 35for I was hungry, and you gave me food to eat. I was thirsty, and you gave me drink. I was a stranger, and you took me in. 36I was naked, and you clothed me. I was sick, and you visited me. I was in prison, and you came to me.'
37"Then the righteous will answer him, saying, 'Lord, when did we see you hungry, and feed you; or thirsty, and give you a drink? 38When did we see you as a stranger, and take you in; or naked, and clothe you? 39When did we see you sick, or in prison, and come to you?'
40"The King will answer them, 'Most certainly I tell you, inasmuch as you did it to one of the least of these my brothers, you did it to me.' 41Then he will say also to those on the left hand, 'Depart from me, you cursed, into the eternal fire which is prepared for the devil and his angels; 42for I was hungry, and you didn't give me food to eat; I was thirsty, and you gave me no drink; 43I was a stranger, and you didn't take me in; naked, and you didn't clothe me; sick, and in prison, and you didn't visit me.'
44"Then they will also answer, saying, 'Lord, when did we see you hungry, or thirsty, or a stranger, or naked, or sick, or in prison, and didn't help you?'
45"Then he will answer them, saying, 'Most certainly I tell you, inasmuch as you didn't do it to one of the least of these, you didn't do it to me.' 46These will go away into eternal punishment, but the righteous into eternal life."