1640s, alteration of pompone, pumpion "melon, pumpkin" (1540s), from Middle French pompon, from Latin peponem (nominative pepo) "melon," from Greek pepon "melon," probably originally "cooked (by the sun)," hence "ripe;" from peptein "to cook" (from PIE root *pekw- "to cook, ripen"). Pumpkin-pie is recorded from 1650s. Pumpkin-head, American English colloquial for "person with hair cut short all around" is recorded from 1781. Vulgar American English alternative spelling punkin attested by 1806.
America's a dandy place:
The people are all brothers:
And when one's got a punkin pye,
He shares it with the others.
[from "A Song for the Fourth of July, 1806," in "The Port Folio," Philadelphia, Aug. 30, 1806]