The Pumpking is the main Pumpkin Moon boss and arrives in wave 10. How to start the Pumpkin Moon, reach wave 10, read his three attack modes and farm his drops.
The Pumpking is the main boss of the Pumpkin Moon in Terraria. You summon him by using a Pumpkin Moon Medallion at night and reaching wave 10 of the event. He keeps spawning in almost every wave after that, and in the last waves two of them can be alive at once.
He is a post-Plantera fight and the hardest enemy of the event. He flies through blocks, swings two blade arms that can't be damaged and switches between three attack modes, which you can read from his face.

Notable drops:
Craft a Pumpkin Moon Medallion at a Mythril Anvil or Orichalcum Anvil. It needs:

Use it at night, ideally right at dusk (7:30 PM). The event ends at 4:30 AM no matter which wave you are on, so every minute counts. It can't be used during a Frost Moon, and using it during a Blood Moon cancels the Blood Moon.
The Pumpkin Moon has 20 waves. Kills give points, and each wave needs more points than the last. In Classic it takes 25 points to reach wave 2, then 40, 50, 80, 100, 160, 180 and 200 for the next waves, and 250 points in wave 9 to bring in wave 10 with the first Pumpking.
Points per kill in Classic:
Points are doubled in Expert and multiplied by 2.5 in Master, so waves go by much faster there. Kill enemies the moment they spawn, because new ones only appear when there is room. The early enemies are weak to Ichor, so a Flask of Ichor or the Golden Shower speeds things up.
The Pumpking has 26,000 health in Classic, 33,800 in Expert and 43,095 in Master, with 40 defense. His two Pumpking Blades swipe at you like Skeletron's hands but can't be hurt, so always aim for the head. He switches between three modes at random, and his head turns to show a new face each time.

The scythes are the real danger. When you see the grimacing face, keep moving in wide circles so the scythes can't line up on you, and never wait next to a group of them. He is fairly slow for a boss, so you can outrun him.
His contact damage is lower than the damage from his projectiles. With wings and high defense, staying close to his head and taking a few blade hits is often safer than dodging scythes and fire in the open. The Flairon works well because he floats right above you, within reach of its homing bubbles.
Mobility helps more than anything else: the Anti-Gravity Hook, the Tabi or Master Ninja Gear, and the Shield of Cthulhu all make him much easier to handle when several bosses are on screen.
Note: Stray Flaming Scythes can fly far beyond the arena and kill town NPCs in their houses. Fight a little away from your town.
The Pumpking may drop one of eight items, and the chance grows with every wave:
In Classic each one starts at 2.5% and rises to 12.5%, and one of them always drops in wave 20. In Expert and Master one of them always drops from wave 12 on, which is why late waves are where you farm. The Pumpking Trophy can drop from wave 15. Master Mode adds the Pumpking Relic and the Pumpkin Scented Candle pet.
Note: If the night ends while a Pumpking is alive, he sinks down through the ground and leaves without dropping anything.
The other mini-boss of this event is covered in How To Summon The Mourning Wood. The Frost Moon is the harder winter version of the Pumpkin Moon, and its final boss is in How To Summon The Ice Queen. For the boss that unlocks both moon events, see How To Summon Plantera.