If you are going to get rid of your iPhone and do not want leave any traces of the applications that you have used or your personal information, or just want to leave it as new, you can restore it to its factory state.
How To Reset iPhone to Factory Settings
Run iTunes, go to View, click Show Sidebar and select your iPhone in the DEVICES section. Go to the Summary tab and click Restore iPhone:
A window opens asking you if you want to save a backup of your iPhone settings, click Save Backup, and then click Do not save copy.
Click on Restore and follow the instructions:
Your iPhone will be left with the factory settings and with the latest operating system available.