As time is a great imponderable, it is related to death. The two words, time and death, are the same in Sanskrit. Kala is popularly known as Yama. Born from the union of Surya (the sun god) and Samjna, daughter of Kassyapa-prajapati, Yama (Kala) was given the duty to retrieve the souls of those whose allotted time was at an end.
After death the spirit of the body was taken by the attendants of Kala to his court, and there the spirit was judged according to the virtue (dharma, punya) and vice that had shown in action in that lifetime. Depending on the judgment, the spirit (pitri) was sent to Vaikuntha (heaven) or Naraka (also called Pitriloka, the land of the spirits).
Kala was one of the Dikpalakas, a guardian of the four cardinal directions. He guarded the southern quarter. His city was called Samyamini (and Yamapuri). In the Katha Upanishad there was a discussion between a lad named Naciketas and Kala (Yama) about the nature of death and that which is deathless.
In late Puranic mythology like that found in the Vishnu Purana, there were twenty-eight Narakas (hells), each more terrible than the one before, with ever- increasing punishment and torments.
Kala (Yama) fared just as badly as some of the other devas, like Indra in later mythology. He was ruled by the laws of karma, could be defeated by the magic of sages or the austerities of demons like Ravana, and was fooled by the play (lila) of supreme deities.