Oh, something similar happened to me just a few hours ago. Though, mine is not an iPhone 5 but an iPod touch 5th Generation bought in June 2013.
Sometimes in July my iPod has issue receiving notifications when in sleep/lock mode I had to unlock the iPod then the notifications start flooding; from Facebook to LINE (chatting app like Watsapp) and TouchArcade and some others it's like they were stored somewhere and programmed to be released only when the iPod is unlocked, the notifications was actually hours ago but received only upon unlocking. The Wi-Fi of course stays connected no problem, it didn't disconnect whatsoever until you lock it.
Then I read and tried a few solution on MacRumors where you have to go to Settings > Reset > Reset Networks then manually enter your Wi-Fi info and it worked like a charm from late July onwards till today where it happened again. I had to repeat the process above. What gives? I'm running iOS 6.1.3 it came installed with it.
Sometimes in July my iPod has issue receiving notifications when in sleep/lock mode I had to unlock the iPod then the notifications start flooding; from Facebook to LINE (chatting app like Watsapp) and TouchArcade and some others it's like they were stored somewhere and programmed to be released only when the iPod is unlocked, the notifications was actually hours ago but received only upon unlocking. The Wi-Fi of course stays connected no problem, it didn't disconnect whatsoever until you lock it.
Then I read and tried a few solution on MacRumors where you have to go to Settings > Reset > Reset Networks then manually enter your Wi-Fi info and it worked like a charm from late July onwards till today where it happened again. I had to repeat the process above. What gives? I'm running iOS 6.1.3 it came installed with it.