iPhone’s automatic screen rotation is convenient. However, it is annoying under some situation, such as reading email in the bed. Fortunately, starting from iOS 4/iOS 5, iOS has an option to lock the screen rotation.
For iOS 7 and iOS 8
For older versions of iOS
It is a little tricky to find it out on older version of iOS.
On older versions of iOS (iOS 4 to iOS 5):