Rotation lock on a iPhone 5
If you're running iOS 6: Double-tap the home button. Swipe to the right (as if scrolling left). There's a button with a rotating arrow with a lock that toggles rotation lock.

If you're running iOS 7 or 8: Swipe up from the bottom of your screen to open Control Center; you may need to unlock your phone first. The rightmost button on the top of Control Center is a similar rotating arrow with a lock.