Why do we wake up when we die in our dreams? A lot of people had some experience with dying in their dreams. They all confirm they remember the whole story until the precise moment of death and it is the death itself what woke them up - not being nervous, scared or shocked (I remember myself dying peacefully in bed in one of my dreams, no fighting or falling involved).

I have never met anyone who continued dreaming after dying - although some religious people should be deeply convinced that the death is not the end of their story. It also quite a common plot of novels or movies: the main character dies and appears in some kind of "afterworld" - I have never met anyone with this experience, though.

Is it caused by the fact that our brain just does not know what happens next when it is all over?

Or is the moment of death such a "low-level" shock for our minds, that it just "reboots"?
When you dream you're in REM sleep (rapid eye movement). REM sleep is only slightly more "deep" than stage 1 of non-REM which means it's not that hard to wake you up in the first place. 

Dying in a dream is a stressful event, which causes your brain to release adrenaline. You can't sleep and have an adrenaline rush at the same time so you wake up. 

These dreams where you die and wake up are usually more memorable due to the fact that you wake up whereas most people don't remember 95% of their dreams.

Sources:

Adrenalin:

"Being particularly scary or threatening, nightmares can provoke ‘fight and flight’ responses, and the release of adrenalin whilst we are still asleep. Once you awaken from a nightmare it may then take a little time to come down from this elevated state, preventing you from being able to get back to sleep as easily or quickly."

https://www.youtube.com/watch?v=9TZOiC23CpI&amp;feature=youtu.be

Profeso Colin Espie, Director of the Sleep Centre at the University of Glasgow and co-founder of Sleepio

Forgetting Dreams:

"We forget almost all dreams soon after waking up. Our forgetfulness is generally attributed to neurochemical conditions in the brain that occur during REM sleep, a phase of sleep characterized by rapid eye movements and dreaming. But that may not be the whole story.
Perhaps the most compelling explanation is the absence of the hormone norepinephrine in the cerebral cortex, a brain region that plays a key role in memory, thought, language and consciousness. A study published in 2002 in the American Journal of Psychiatry supports the theory that the presence of norepinephrine enhances memory in humans, although its role in learning and recall remains controversial."

http://www.scientificamerican.com/article/why-do-memories-of-vivid-dreams/

"At least 95% of all dreams are not remembered. Certain brain chemicals necessary for converting short-term memories into long-term ones are suppressed during REM sleep. Unless a dream is particularly vivid and if one wakes during or immediately after it, the content of the dream is not remembered"

Hobson, J.A.; McCarly, R.W. (1977). "The brain as a dream-state generator: An activation-synthesis hypothesis of the dream process". American Journal of Psychiatry 134 (12): 1335–1348.