I have a Samsung Galaxy S5 phone running on Android 5.0. At home and in the office, when I'm connected to a WiFi network and the screen is locked (sleep), WhatsApp doesn't receive any messages until I unlock the screen. I don't use so many apps so I can't confirm if this is the case with other applications or not, however, I might have experienced the same problem with the email app as well.
I have observed my phone behavior and noted that other applications (e.g., hangouts) show act the same. Furthermore, I noted another fact that might shed some light: Say, I unlock my screen and after several seconds my apps start to notify me about some messages. But the time-stamp of these messages aren't for this moment but rather [e.g.] half an hour ago when they were supposed to be delivered.
"Keep Wi-Fi on during sleep" is set to "Always", I don't have any power management application or any particular settings. I checked WhatsApp FAQ and they suggested checking priority notification, which I don't use. Searching the web suggests clearing cache and data which doesn't solve the problem. I have cleared the cache/data files, updated the app, etc. I would highly applicate if you submit answers that do not suggest these generic (and almost always non-functional) workarounds.