The term 'jack-o'-lantern' was first applied to people, not pumpkins. As far back as 1663, the term meant a man with a lantern, or a night watchman. Just a decade or so later, it began to be used to refer to the mysterious lights sometimes seen at night over bogs, swamps, and marshes.
For centuries people told stories to explain the mysterious lights. In Ireland, dating as far back as the 1500s, those stories often revolved around a guy named Jack.