Try turning it on while it is connected to the charger cord and see if it will stay on longer. If not, then try turning it on in "Safe Mode" and see if that allows it to stay on. If it stays on in "Safe Mode" then it is a virus, malware, bad app, etc. that would be the cause you would have to find and remove the problem. However, if it won't stay on even in "Safe Mode" then I would be looking at the battery needing replacing.
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 manufacturers logo on the screen, then release the power button.
3. "Quickly" press "Volume Down" and hold it for few seconds until you see the message "Safe mode: ON" or something similar.
4. If you wanted disable it, simply repeat the steps above, and you should see "Safe Mode: OFF" rather than on.