That iPhone keeps rebooting itself is not a common issue, but this so sucks on the unlucky users. Look at our following solutions to fix.
Firstly, we would strongly recommend checking the Power button to make sure there are no problems relevant (it gets stuck or seems to be broken...). Then users should attempt in order from solution 1 to solution until the problem is gone away.
Solution 1: Force reboot the iPhone
You need to turn off completely all operating apps then press and hold both Home & Power buttons untill the iPhone restarts itself.
Solution 2: Reset All iPhone Settings
Settings → General → Reset → Reset All Settings.
Solution 3: Turn Off Cell Data
Turning Off the Cell Data does work on may users.
Settings → Cellular/Mobile → Turn On/Off Mobile Data.
After all above, you might want to Restore the iPhone from Recovery Mode, but we do not suppose this works.
It's now time to equate the issue to Hardware problems: Battery or Cable connector. Bring the iPhone to a friendly Apple repair service to fix for a reasonable free.