According to Buddhism, there is an endless circle of transmigration in 六道(Rokudo)-six posthumous worlds, depending on their behavior before death.
They are ..
地獄(jigoku) - hell
餓鬼(gaki) - preta : the world which always suffers from hunger
畜生(chikusho) - realm of beasts
阿修羅(ashura) - the world fightings never end
人道(jindo) - the world human beings live
天道(tendo) - the world celestial beings live
恵心僧都源信(eshinsozu-genshin) is a monk (942-1017) in Heian era, who showed the images of after death. His images have hugely affected on the hell and heaven the Japanese image.
The aim in the Buddhism seems to be to leave the Rokudo and live in 極楽浄土(paradise, eden, nirvana). It is called 解脱（gedatsu in Japanese).
After a funeral, we have a custom to have ceremonies for the 7th day, 49th day and the 3rd year after the death at the temple where the grave is.
That's because it is believed that the next world the dead person will live is judged by 十王(ju-ou) ,meaning ten kings, on mostly every 7 days after death.
The 7th day is the day for the first judge, and the 49th day is the day the judge is finally decided.
The relatives and a monk pray for him or her going to the nirvana.
The name of the kings :
秦広王 (shinko king) - 7th day
初江王(shoko king) 14th day
宋帝王(sotei king) 21th day
五官王(gokan king) 28th day
閻魔王(enma king) 35th day
変成王(henjo king) 42th day
泰山王(taizan king) 49th day
平等王(byodo king) 100th day
都市王(toshi king) 1st year
五道転輪王 (godotenrin king) 3rd year
Special exhibition at Mitsui Memorial Museum in 2017
`Wonderland of buddhism hell scenes'