Well it is possible that the battery isn't holding a full charge and that is causing it to go off. You could also have some sort of "Echo Mode" set up on the phone (even without realizing it) that is turning it off when it reaches a certain battery percent.
Or it is possible that something running on the phone (that you possibly didn't intend to put there) is the cause. Try turning the phone off and then load it in "Safe Mode". Leave it in that for a while and see if the problem still occurs. If it doesn't, you have something on your phone that needs to be remove/uninstalled as it is turning it off.
To get into "Safe Mode" please do the following.
1. First turn off the phone.
2. Next press and hold "Power" until you see the...