Jack O'Lantern legend goes back hundreds of years in Irish History. Many of the stories, center round Stingy Jack.
Here's the most popular story:
Stingy Jack was a miserable, old drunk who took pleasure in playing tricks on just about everyone: family, friends, his mother and even the Devil himself. One day, he tricked the Devil into climbing up an apple tree. After the Devil climbed up the tree, Stingy Jack hurriedly placed crosses around the trunk of the tree. Unable to touch a cross, the Devil was stuck in the tree. Stingy Jack made the Devil promise him not to take his soul when he died. Once the devil promised not to take his soul, Stingy Jack removed the crosses, and the Devil climbed down out of the apple tree.
Many years later, Jack died, he went to the pearly gates of Heaven and was told by Saint Peter that he was mean and cruel, and had led a miserable, worthless life on earth. Stingy Jack was not allowed to enter heaven. He then went down to Hell and the Devil. The Devil kept his promise and would not allow him to enter Hell. Now Jack was scared . He had nowhere to go, but to wander about forever in the dark Netherworld between heaven and hell. He asked the Devil how he could leave, as there was no light. The Devil tossed him an ember from the flames of Hell, to help Stingy Jack light his way. Jack had a Turnip with him. It was one of his favorite foods, and he always carried one with him. Jack hollowed out the Turnip, and placed the ember the Devil had given him, inside the turnip. From that day onward, Stingy Jack roamed the earth without a resting place, lighting his way as he went with his "Jack O'Lantern".
On all Hallow's eve, the Irish hollowed out Turnips, rutabagas, gourds, potatoes and beets. They placed a light in them to ward off evil spirits and keep Stingy Jack away. These were the original Jack O'Lanterns. In the 1800's a couple of waves of Irish immigrants came to America. The Irish immigrants quickly discovered that Pumpkins were bigger and easier to carve out. So they used pumpkins for Jack O'Lanterns.