Hammurabi was born in 1792 BCE and became the sixth king of Babylon that same year when his father abdicated. He ruled for his entire life (presumably with a regency at first), and despite the war town nature of Mesopotamia in that era, he is best known for the relative peace of his reign, his public works programs and, of course, his legal code, which is the earliest known one.
When he died, at the ripe old age of 42, he had also expanded the borders of his kingdom enormously, leaving his own son a realm that was more than six times the size of the city state he had inherited, one that stretched from the shores of the Persian Gulf to Mari, hundreds of miles up the Euphrates.