"The Peasant in Heaven" is a German fairy tale collected by the Brothers Grimm in Grimm's Fairy Tales, number 167.
It is Aarne-Thompson Type 802.
The Peasant in Heaven Wikipedia
A Peasant and a Rich Man went to Heaven. Saint Peter let the Rich Man in but overlooked the Peasant; there was then great rejoicing and music in Heaven. Then St Peter noticed the Peasant and let him in, but there was no celebration. When the Peasant asked why, St Peter said that many poor people go to Heaven, but a rich man does only once a century or so.