Just to be sure .....
If you see a lock icon in the upper right corner of the screen - then the screen orientation is locked.
Try the side switch above the volume rocker first and see if that unlocks the screen. If that doesn't do it, double tap the home button and swipe to the right and look for the lock icon all the way to the left.
If the screen is unlocked but still will not rotate, reset the iPad.
Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
See here http://support.apple.com/kb/HT4085
Enabling Rotation Lock if "Use Side Switch" is set to Mute
Rotate iPad so the display is in the desired orientation.
Double-click the Home button to display recently used apps.
Flick from left to right along the bottom of the screen.
Tap the Screen Rotation Lock button on the bottom left of the screen.
A padlock will appear in the Screen Rotation Lock button.
A small Screen Rotation Lock icon appears in the status bar until you disable Screen Rotation Lock:
OK, the orientation of the Apps will depend on the developer, so if some show as horizontal and some show as vertical, that is how the developer has programmed them as the default view.
You need to determine if it's a Hardware or Software issue in the iPad.
You do not really have any control on the Hardware side of things so initially, so at the moment, don't worry about that.
Software, you do have some control over.
Is there a setting in an App that may be running in the background, that you have set not to rotate? If you can think of anything, go to the settings of that App and turn off the lock rotation setting and see if that resolves the issue.
Have you recently installed a new App, and since then, has the issue developed. If so, remove the new App and see if it fixes the issue.
If you cannot think of an App setting or any new Apps, then you need to consider reinstalling the whole OS to see if that resolves the issue.
If you need to to that, the first thing you need to do is to Backup the iPad to iTunes, and also you make sure you download any new photos/movies that you have on the iPad to you computer.
Then with the iPad all backed up, Restore the device to 'New' using iTunes.
This will wipe the iPad and resore it to factory settings.
Now test the iPad and see if the screen rotation issue is resolved.
If it is resolved, it was something in the iPads settings or Apps that was causing the issue.
Now you have two choices, you can reconnect to itunes and restore the iPad again, but this time from 'Backup' and it will bring back all the old settings, Apps etc onto the iPad, and test again to see if the issue is back again, or just resync the device with all the settings you want for each area in iTunes.
If none of the Software solutions work, then it is a Hardware issue and you need to take the device to Apple for them to resolve for you.
Hope this helps.
I have seen this problem twice on my iPad 2, running IOS 5.x.
My side button is set to mute the sound.
It does not help to turn off the iPad, but I change the function of the side button
to lock unlock the rotation, and then press it a few times, then I reset the function
of the button to mute again, and then it works...
Seems like bit rot...