Death is where the brain loses coherence and reaches an irretrievable state of decay. Or more specifically when the cells within the brain begin to breakdown and cease to function. Cells will typically begin to decay within 30 minutes of being starved of oxygen. The duration varies depending on the surrounding temperature.
Theoretically if the brain could be kept very cool from the moment of loss of heart beat, and perhaps even deep-frozen before any brain cells started to deteriorate, and if the cause of the bodily damage could be repaired and the heart restarted then it might be possible to re-animate the brain and final death averted. The period of freezing could theoretically be indefinite. These processes of cryonics are currently being used although the technology is still evolving, and as yet no one who has undergone cryogenic suspension has been restored, and no attempts to restore have been made yet.
Questions concerning life-energy, souls, etc, are outside the realm of science, and there is currently no scientific evidence to even suggest such speculative entities can or do exist.
After death: Once the brain cells decay irretrievably then all mental, memory, and cognitive functions that once represented the living person will be permanently lost. There is no scientific record of any person ever recovering from such a state.
Cris