The iPhone can generally detect the intended orientation of a photograph you snap, but occasionally even your smartphone can get confused. If you need to rotate the picture, turn to the default Photos app on your phone.
Edit Pictures with the Photos App
The Photos app is the default repository for all the pictures you take with your iPhone camera. To rotate a photo, simply select it from the camera roll, tap "Edit" and then tap the rotate button. The photo will rotate 90 degrees counter-clockwise each time you tap the rotate button. You can also enhance picture quality, apply filters, remove red eye and crop photos from the Edit Photo screen.
Advanced Photo Editing with Apps from the App Store
Apps like Adobe Lightroom, Adobe Photoshop, Snapseed, iPhoto and Pixlr Express provide advanced photo editing features not found in the native Photos app. In particular, if you want to refine the rotation to your photos or realign the horizon line, you will need to turn to paid or free photo editors available from the App Store.