My iphone always restarts by itself My iPhone often restarts automatically. It happens when I charge for long time and sometimes, it happens when I'm talking on phone .
The best thing to do is to first try a backup and restore as new as detailed in 


  http://support.apple.com/kb/HT4137 


A lot of the time a device restarting multiple times can be caused by a software issue, and frankly getting all your data on the computer is always a  a good idea. 

This will also make sure you are updated to the most recent version in case you are working with old software.
If it doesn't work it is probably time to get a new one or go for a repair.