Feeding them to my military.
Also I am disappointed no one mentioned magma.
One of my favourite execution methods of all time involves my quarry pit. Creatures fall from the surface to the magma sea, at which point their body has so much momentum that their limbs all gib violently and bounce into the air several z layers. The limbs then soar in a red arc, before falling into and being consumed by the magma sea.
Another execution method involved dropping unfortunates into what I called the moose pit, which was a pit full of layers upon layers of horrifying undead. This would further make the horde larger. It was also somewhat disturbing to see resurrected corpses of foes, their wounds forever preserved, eternally gushing blood from their throats for example.
Arena combat is always a must. If I only have creatures of one civilization/combat team, then I just pit them against my Dwarves or have them run a grueling gauntlet against their peers. If I have multiple sides, then the arena can get creative, with things like high-altitude fighting (exactly what it sounds like) or arena matches like avoid the dog pit.
Running the gauntlet is perhaps my all-time favourite overall. It doesn't take that much resources to set up (indeed only as much as you want). You release your prisoners at the start, they make a dash for the exit - once they reach the exit they get their freedom. Sounds simple enough, except there's traps, hounds and marksdwarves all along the way. Once the victor has reached the exit, they trigger a pressure plate which activates either all the retracting bridges dropping all the prisoners down to whatever lies below (could be spikes, could be cages so they get a round 2) or the pressure plate activates the pumps which fills the hallway with water or magma. If you were especially cruel, you could cage the victor at the end to have a victor's series, fought between the champions of champions.
Mostly though, unless I'm especially bored, prisoners are kept under humane conditions. I like having large prison populations; indeed, one of my first Forts failed because my foremost priority was to create a prison that was too large for my resources to permit. One of my favourite Forts was an underwater prison beneath a lake, with row upon row of prisons with conditions almost as good as those of their Dwarven jailers, with the only downside being the isolation, lack of freedom and well... It was a prison after all. When the Dwarves at last faced calamity and died... I never did pull the lever to let them go. Given the immortality of goblins, they're still down there. And in both of my current Forts I have prisoners living in comfortable confinement; a breeding program of rat people to try and create a serf caste of sentries in one (they live in the only house in the map), and in the other the humans I have captured live in one of the highest levels of my residential tower, with windows, masterwork beds, chairs, tables and plenty of tools to train with. Sometimes my prisons are downright evil though. I took inspiration from the sky cells from the Eyrie in Silentthunders for example, where there's a cell with three walls (one stone, two made of grates so prisoners can see each other panic) with the north face just being a sheer drop down into the magma sea. If any creature wants to end their confinement, providing they weren't chained to their cell, they'd need only jump off the edge. Another I'm trying to refine involves a raised platform, with an unfortunate above constantly being harassed by hounds, but that usually ends too quickly. One of the ones I'm working on perfecting is this:
d
+
+e
++
++g
+++
+++g
++++
++++
++++
++++
++++
++++
++++
++++^ <- Certain death
Where in essence, you have a linear path that can only be progressed by dodging, and only one-way. Drop creatures in on the highest level, they get annoyed about having to share one tile, fight (and either kill each other) or one of them dodges to a level below. This keeps happening until the final rung, at which point they dodge to certain death: A long fall into a pit of serrated discs, spikes and anything assigned to clean up the body parts. It's execution via King of the Hill.
If they're not being sacrifced to a deity, if they're not used in the arenas, if they're not running the gauntlet, if they're not spending the rest of their lives in a cell, they will either serve two fates. The first is simple freedom. If I feel especially kind/bored/pitiful for whoever I've captured and they're not of any scientific interest, I just let them go. This mostly happens when a siege or ambush attacks, I have an abundance of prisoners, and I feel that whoever attacked was justified (albeit foolish) to attack my fort (such as, the humans declaring war because I kidnapped all of their merchants and guards, driving the former insane). I then let the battered survivors go home, rather confused as to why they're being shown such mercy.
The other fate is !!SCIENCE!!, and I feel it is long since I got to put exclamation marks around SCIENCE. If I need living subjects to discover what effect a certain syndrome has/how it is applied, deploy the prisoners. If I want to reproduce a lycanthropy curse, deploy the prisoners. If I need corpses for research or war corpse manufacturing, deploy the prisoners. If I need to test the battle effectiveness of certain war animals or war corpses, deploy the prisoners. If I must test the effectiveness of certain alloys and certain weapons, deploy the prisoners. If there is a threat I wish to assess before taking action, deploy the prisoners. If I wish to test a theory outside of arena mode and in the random environment of DF mode, deploy the prisoners. If I must test how civilizations path around traps, and how they collectively map Fortress traps, deploy the prisoners. If I must test how to improve burn victim survival rates, deploy the prisoners. If I must test how to improve blood loss survival rates, deploy the prisoners. If I must test how to better employ cave ins, deploy the prisoners. If I must test how to better utilize cage traps, deploy the prisoners. If I find necromancer prisoners, into the corpse assembly line seat they go. Necromancers probably have it easiest, as they're the most skilled of prisoners, and most useful. But they will never be allowed freedom, for they are too dangerous.
To be a science prisoner is a miserable affair. I try to treat science prisoners especially well before and after experiments, but perhaps it would be better just to execute them instead of prolonging their wretched lives. But, you know as they say, the experiments must go on...