In Hinduism, karma is a big thing. The karma you have accumulated, may it be good or bad determines your condition in the afterlife and when you reincarnate.
In the afterlife, depending on the karma you have accumulated, you are put in either Naraka (hell) or Svarga (heaven). The Naraka is governed by the god Yama while Svarga by Indra. There are many layers of hell and heaven that gives punishments and rewards accordingly.
The Naraka and Svarga is only a temporary place for human souls. Its only an intermediate before the soul is then brought back to earth to be reincarnated to other lifeforms. It is also a place for the soul to feel the consequences of their karma and to imprint the consequences to either not do bad deeds anymore or to do more good in the next life.
It is believed you will forever go through this cycle of death and rebirth. Only until you reach the state of Moksha, which is a bit like Nirvana where you’re 100% free from everything, will you be able to be released from this death and rebirth cycle.