Yama belongs to an early stratum of Vedic mythology. In Vedic tradition Yama was considered to have been the first mortal who died and espied the way to the celestial abodes, and in virtue of precedence he became the ruler of the departed. Yama's name can be interpreted to mean "twin", and in some myths he is paired with a twin sister Yamī.
His influence has also spread into Buddhism where he is known as Yanluo Wang in China and Enma-O, or Lord Enma, in Japan. He is the God of Death and ruler of Diyu (the underworld) and is often portrayed with a red scowling face and wearing a Chinese judge's uniform. He judges all those who enter the underworld and determines what punishments they are to serve in hell before they are reincarnated. He is also the master of Horse-Face and Ox-Head. There are several beings who rule over the Chinese Underworld, ten gods ("Kings") who preside over ten halls of the Chinese Underworld.
In Tibet, he is recognized as a Dharmapala and one of the eight main Dharmapalas, alongside Mahakala, Yamantaka, Hayagriva, Vaisravana, Palden Lhamo, Tshangspa Dkarpo, and Begste. According to one legend, a holy man who had been meditating for almost 50 years had been disturbed by thieves who stole a bull and proceeded to decapitate it. After the thieves realized the man had seen what they had been doing, they decided to kill him, and when they did, the man turned into Yama (known in Tibet as Shinje) in a near enlightened fury, and then killed the two thieves. He then rampaged and threatened to kill everyone in Tibet until Yamantaka defeated him.
The Megami Tensei portrayal of Yama seems to be more influenced with the Chinese interpretation than the Vedic one based on his appearance and the fact that the Chaos Hero refers to him as Lord Enma.
Shin Megami Tensei
"Origin: India. The first mortal in Hindu lore. In the Rig Veda, Yama is founder of the land of the dead, and his kingdom was a paradise. When transplanted to Buddhism in China, he became known as Enma."
—Shin Megami Tensei A-Mode DDS Dictionary
Ruling over Ikebukuro, Yama bestows the law of the Gaeans on those that enter his territory. He judges the protagonist's actions of controlling demons on a trial and is up to the player to decide if he will accept Yama's request of aiding the Chaos forces on the destruction of the Cathedral of the Messians, and thus be absolved of any charges, or reject his offer and thus being thrown in jail, where he will eventually be freed by the Chaos Hero and will end up having to fight Yama.
Devil Summoner: Soul Hackers
"In Hindu lore, he is a god who manages Hell. He was born human with his twin sister named Yami, but died first, which filled Yami with sorrow. The gods created day and night for her to forget Yama. Being the first person to die, Yama guided the deceased to the land of the dead, but eventually began punishing them according to their deeds while alive. Originally, the land of the dead consisted only of heaven, but through Yama's work, Hell was born."
—Devil Summoner: Soul Hackers 3DS compendium
Yama is a demon exclusive to the 3DS remake, available after Nemechi evolves into the angel stage of the female growth path, and can be purchased for 300 D-Souls.
Megami Ibunroku Persona
Yama is the first Persona of the Hierophant Arcana and can be fused by using the Enma Notebook Totem during fusions resulting in the Hierophant Arcana. The Enma Notebook can be purchased from the Judgement 1999 Casino at the Mikage Sun Mall shortly after the start of the game. Yama easily surpasses Aizen Myouou as it ranks up, despite having a lower level and upon being returned to the Velvet Room at MAX Rank, it yields a Para Stone.
Yama is fought when it is summoned by Keisuke Takagi. Yama is one of the demons that is initially summoned without a COMP because of Keisuke's desire to punish the wicked. If you choose to save Keisuke near the end of Day 4, you will be able to fuse Yama.
Devil Survivor 2
"In Hindu lore, he is a god who manages hell. He has been incorporated into Buddhism as well, where he is well-known as King Enma. He was originally born human and had a twin sister named Yami. Yama died first, which filled Yami with sorrow. The gods created day and night for her to forget Yama. As the first person to die, Yama was given the role of guiding the deceased to the land of the dead, but he eventually began punishing them according to their deeds while alive. Originally, the land of the dead consisted only of heaven, but through Yama's work, hell was born over time and he came to manage it."
Keisuke once again summons Yama to punish cops abusing their COMPs. The goal here is to defeat Yama to get Keisuke to realize the error of his ways. If the player chooses to forgive Keisuke, Midori will leave the party and Keisuke will join.