Almost everybody does it or has at least once, but do you know why?
Well, according to wikipedia, a jack-o'-lantern is a carved pumpkin or turnip lantern. It got its name after the phenomenon of a strange atmospheric ghost light seen by travellers flickering over peat bogs, swamps or marshes at night. They called it will-o'-the-wisp or a jack-o'-lantern. It was said to resemble a flickering lamp and to recede if approached, drawing travellers from the safe paths.
As you may well know, the top of the pumpkin or turnip is cut off to form a lid, the inside flesh is scooped out, and an image — usually a monstrous or comical face – is carved out of the rind to expose the hollow interior.
To create the lantern effect, a light source is placed inside before the lid is closed. Generally speaking the light source is a flame such as a candle or tea light, but artificial jack-'o-lanterns with electric lights are also a thing now.
It is common to see jack-o'-lanterns on doorsteps and otherwise used as decorations prior to and on Halloween.
It is believed that the custom of making jack-o'-lanterns at Halloween began in Ireland.
In the 19th century, "turnips or mangel wurzels, hollowed out to act as lanterns and often carved with grotesque faces," were used at Halloween in parts of Ireland and the Scottish Highlands.
In these Gaelic-speaking regions, Halloween was also the festival of Samhain and was seen as a time when supernatural beings, and the souls of the dead, roamed the earth.
As Irish immigrated to America, they found pumpkins to be far easier to carve than turnips for Halloween.
Now jack-o’-lantern carving has exploded and the ghoulish gourds are everywhere.
Now... As the story goes...
Stingy Jack, perhaps also known as Jack the Smith, Drunk Jack, Flaky Jack, and Jack of the Lantern, is a mythical character apparently associated with All Hallows Eve. The "jack-o'-lantern" may be derived from the character.
As the story goes, several centuries ago amongst myriad towns and villages in Ireland, there lived a drunkard known as "Stingy Jack". Jack was known throughout the land as a deceiver, manipulator and otherwise dreg of society. On a fateful night, Satan overheard the tale of Jack's evil deeds and silver tongue. Unconvinced (and envious) of the rumours, the devil went to find out for himself whether or not Jack lived up to his vile reputation.
Typical of Jack, he was drunk and wandering through the countryside at night when he came upon a body on his cobblestone path. The body with an eerie grimace on its face turned out to be Satan. Jack realized somberly this was his end; Satan had finally come to collect his malevolent soul. Jack made a last request: he asked Satan to let him drink ale before he departed to Hades. Finding no reason not to acquiesce the request, Satan took Jack to the local pub and supplied him with many alcoholic beverages. Upon quenching his thirst, Jack asked Satan to pay the tab on the ale, to Satan's surprise. Jack convinced Satan to metamorphose into a silver coin with which to pay the bartender (impressed upon by Jack's unyielding nefarious tactics). Shrewdly, Jack stuck the now transmogrified Satan (coin) into his pocket, which also contained a crucifix. The crucifix's presence kept Satan from escaping his form. This coerced Satan to agree to Jack's demand: in exchange for Satan's freedom, he had to spare Jack's soul for ten years.
Ten years later to the date when Jack originally struck his deal, he found himself once again in Satan's presence. Jack happened upon Satan in the same setting as before and seemingly accepted it was his time to go to Hades for good. As Satan prepared to take him to hell, Jack asked if he could have one apple to feed his starving belly. Foolishly Satan once again agreed to this request. As Satan climbed up the branches of a nearby apple tree, Jack surrounded its base with crucifixes. Satan, frustrated at the fact that he been entrapped again, demanded his release. As Jack did before, he made a demand: that his soul never be taken by Satan into Hades. Satan agreed and was set free.
Eventually the drinking took its toll on Jack and he died, Flaky Jack's soul prepared to enter Heaven through the gates of St. Peter, but he was stopped. And Jack was told by God that because of his sinful lifestyle of deceitfulness and drinking, he was not allowed into Heaven. Jack then went down to the Gates of Hell and begged for commission into underworld. Satan, fulfilling his obligation to Jack, could not take his soul. To warn others, he gave Jack an ember, marking him a denizen of the netherworld. From that day on until eternity's end, Jack is doomed to roam the world between the planes of good and evil, with only an ember inside a hollowed turnip ("turnip" actually referring to a large rutabaga) to light his way.
Irish families told the tale and began to put carved out turnips in their windows to prevent Stingy Jack and other ghouls from entering the home. Some had scary faces carved into them to frighten away any comers.
Once the tradition hit the United States, Irish immigrants soon realized that the pumpkin, native to the states, was an ideal fruit for carving. That's why you see jack-o'-lanterns on porches around Halloween.