Not all Jewish people believe this and at first none did but….
In Judaism Gehenna is thought to be a place where unrighteous souls are punished. Gehenna is not mentioned in the Tanakh or any of the Jewish writings until around the 6th or 7th century BCE, but later it became an important part of some of the Jewish concepts of the afterlife and stood for divine justice in the time of assessment after death.
( I personally don’t believe in any kind of punishment after death except the separation from our God, which is the worst punishment possible.)
Some of the Jewish rabbis thought that anyone who did not live for and walk the ways of God and Torah would go to Gehenna for a while. (a fiery hell where you burn forever is a Christian concept stemming from the teachings of Paul.)
Some of the Jewish writings say the time spent in Gehenna would be 12 months and other writings say 3-12 months.
But they also taught that you could repent up to the time you were about to enter the gates to Gehenna.
Gehenna is not the grave