According to legend, the jack-o'-lantern took its name from a reprobate Irishman known as Stingy Jack who tricked the Devil into promising he wouldn't have to go to hell for his sins. When Jack died he found out he had been barred from heaven, so he journeyed to the gates of hell to demand his due. Wouldn't you know it, the Devil kept his promise and doomed Jack to wander the earth for all eternity with only an ember of hellfire of to light his way. Thenceforth he was known as Jack O'Lantern.
It wasn't until Irish immigrants brought the custom of carving jack-o'-lanterns to North America that the more commonly available pumpkin came to be used for that purpose, and not until the mid-to-late 19th century that pumpkin carving became a Halloween staple across the United States.