Several users have reported an issue where the iPhone's slider gets stuck. That is, when attempting to unlock the iPhone -- as is necessary when waking the device manually, or when receiving a phone call -- the slider does not respond to touch, refusing to move across and properly perform an unlock.
Reset This problem may, in some cases, be the result of overall sluggish iPhone performance. As previously reported, poor performance (particularly with regard to interface elements not responding), can benefit tremendously from a full reboot. To turn the iPhone off completely, press and hold the Sleep/Wake button (on top of the device) for a few seconds then slide the red slider. Turn it back on by holding the Sleep/Wake button until the Apple logo appears.
Restore Failing that, a restore may be in order. Connect it to your Mac or PC and, in iTunes, click the Restore button under the Summary tab. Restoring the phone will erase contacts, calendars, photos and other data on the phone, but will restore automatically backed-up information including text messages, notes, call history, contact favorites, sound settings, widget settings, etc.
Close applications We've also received reports from some users indicating that this problem is much less likely to occur if the iPhone is returned to its home screen before being put in locked (sleep) mode.