According to Jim Henson's Labyrinth: Coronation (major spoilers ahead if you haven't read it):
Jareth was a human child born in 18th century Venice whose father, Alfred Tyton, was an elite and mother, Maria (the brave-heart protagonist of the story) was a maid. Jareth's father had struck a deal with the Goblin King to take the throne when it was time. But when the time came, he gave up his son to them instead of himself. Maria, who had a fight shortly before walking out with baby Jareth, was attacked by the Goblins who snatched her son away. Maria, when she realized who was behind the abduction, begged the Goblin King to give him back.
The King too, like Jareth, gave her 13 hours time to go through the Labyrinth to rescue her son. After a bizarre time of facing many many difficulties, Maria managed to get her son, but also figured that this Goblin King was evil (unlike Jareth) and didn't want a replacement for himself, but a new body which he could possess and live on. Maria and gang stop him from doing so, and he expires, but the clock strikes 13, meaning Maria has been defeated. The goblins show her that the future that awaits her and her child is miserable, and apparently she won't be able to keep him anyway, because his grandfather will take him away. Maria, knowing this, still proceeds to leave with the baby.
This is all told by Jareth, now the king of Labyrinth as a form of story. Our secondary narrator of the story, Beetleglum, a goblin, adds that there was some sort of accident, when Maria tried to leave, meaning either she was trapped with Jareth in the Labyrinth, or maybe a part of her and the baby managed to leave, while a figment of them stayed back. Either way, Jareth was the child, or at least the part of the child, who was raised by Beetleglum, and Jareth says the child thanks him for that.