Ambient light sensor not working when moving from light to dark rooms with an iPhone or iPad
I have noticed that Auto-Brightness works much better on my iPhone then it does my iPad 2, but here are a few things you can check...

Go to settings > Brightness &amp; Wallpaper 

Slide the brightness slider to the left... Doesn't really matter where as long as it isn't all the way to the right (max brightness) mine is about in the middle, make sure the toggle for Auto-Brightness is set to on.

You can test it by:

Press the "Home" button and then lock your iPhone by pressing the "Sleep/Wake" button. Move into an area with bright ambient light and use your hand to cover the top third of your iPhone screen. Press the "Home" button and move the slider to unlock your phone. The screen should appear dimmed. Remove your hand from the top third of the display. If auto-brightness is working properly, your screen will get brighter.

You can read more about it here: http://techtips.salon.com/iphone-auto-brightness-works-3626.html