Death

Death happens when heroes fail at Death's Door: heroes struck while at Death's Door have a 33% chance to die. Heroes that suffer a Heart attack while at Death's Door will die instantly. Resistance to DEATHBLOW is determined by Trinkets and Quirks plus Flagellant has naturally by default lesser risk of receiving a killing blow, because it's 27% (6% less).

In The Crimson Court (DLC), a hero affected by the Crimson Curse will instantly die of thirst if he doesn't drink The Blood at the end of the Wasting State.

Cancelling Death
When a hero falls, they cannot be recovered normally. There is a very low chance to have the Town Event From Beyond, which allow the player to resurrect one of 3 random heroes from the graveyard. Revived heroes will retain their quirks and resolve level, but their armor, weapons, and skills upgrades will be lost.

Game Over
There is no real Game Over in Darkest Dungeon. Recruiting new Heroes is free. And because of that you can embark over and over again with new Heroes. By going in, collecting some Gold and then dismissing useless heroes you can build your Gold back up, although Gold problems should be easy to avoid.

In Stygian mode, however, there is an added failure condition where if the player does not complete the game in 86 weeks where the Final Boss awakens prematurely or has 12 deaths as the deaths of the adventurers cause the Final Boss to awaken from the blood of their deaths, they will get a Game Over and have their save subsequently deleted.

If the Final Boss of a Stygian mode file is defeated, the save will no longer be deleted automatically and the time and death limits will be removed.

If the Crimson Court DLC is added, Stygian mode changes its name to Bloodmoon mode and the player gets an extra 14 weeks (total of 100) and 4 deaths (total of 16) before the game ends. It's not required to kill Crimson Court bosses to finish the Bloodmoon campaign.