The most probable reason of your Auto-shutdown could be low battery. (I know its "duh", but bear with me)
Reason 1: Wrong Battery Stats:
This is most probably the problem, because some time ago, I was also in the same position as yours.
Here, you will see that your battery is well above 15%; yet it shutsdown in middle of it, and act asif the battery is finished (not booting there-after).
The thing is, that the battery is finished, but your phone is actually getting the wrong or messed up battery stats.
So when your battery is 1%, your phone is showing 20%.
And then BOOM your phone shutsdown unexpected to both user and the phone.
For me, In order to reset the battery stats, I have to pull out the battery and plug it in again, then with charger on, boot it and it will show correct battery stats.
The culprit?, well it was Easy Tether app.
I used it to connect to my PC and use the WiFi-internet on PC.
As I connected my phone to the PC, it was charging.
And Easy Tether, somehow, messed up my Battery Stats.
(I simply switched to PDAnet+ to get resolve it.)
Solution: You can re-calibrate your battery stats, by deleting the batterystats.bin system file (take precautions tho!).
UPDATE: @Arch gave a very good source about Re-calibrating Battery Stats Please take a look at it!
Reason 2: Damaged Battery.
Well, nothing can be done about this. Find a new battery and see if the problem persist.
If these dont work, try to be more specific about your circumstances.
You have hardly given any information you know.