It could be a bad app on the device (or even a virus or malware) that is causing the issue. So I would try starting the tablet in "Safe Mode" and see if it will stay on. Granted you will have limited access while in that mode, but if it stays on, then you know there is something on the tablet that needs to be removed.
Should that not work (and it continues to turn off even in "Safe Mode") then I would look at the battery needing replacing, or even another hardware issue.
To get into "Safe Mode" please do the following.
1. First turn off the tablet.
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.