If your iPhone is locked for 7 hours, it could be due to a number of reasons. The most likely explanation is that you may have entered an incorrect passcode too many times and the device has gone into a security lock mode to protect itself from unauthorized access. To unlock your device, you will need to wait the full 7 hours or restore your device using iTunes if you have previously backed up data on it. Additionally, if you are signed into iCloud and Find My iPhone was enabled at the time of locking, you can use the iCloud website or app to unlock your device remotely.