What to do before you sell, give away or trade in your iPhone, iPad or iPod touch?
Apple has documented the steps required in a support article.

If you have Find My Phone enabled, disable this otherwise the buyer will be contacting you to get your account to activate the phone. This can be achieved by switching the Find My iPhone option in Settings > iCloud.

Then en Settings > General > Reset and choose Erase All Content and Settings.

This will wipe all personal data off the device (including all apps) and when it restarts it will be at the beginning of the wizard to set up a new device.

This will not effect any other devices linked to the same iCloud account, it purely clears the current device.

This process is necessary as Apple added an Activation Lock in iOS 7. Details can be found here and the support article is located here.