The only time I have seen them hold a wifi connection is if they are plugged into a power source.
The devices do connect and disconnect at random intervals, which is what you might be seeing. However, they are not stay constantly connected to WIFI.
I have DDWRT on my router and can see the apple devices connecting and disconnecting.
Then this is very strange. For the last 2.5 years I've had an iPad sitting next to me at work and at home, nearly 24/7, and my push emails and iMessages notifications sound off on my iPhone and iPad nearly simultaneously (sometimes give or take 10 seconds), regardless of being plugged in to the charger/Mac or not. And this is without cellular on the iPad turned on.
I noticed it right away on my new mini because my phone was making the "new email" sound while the iPad mini was not.
Could this be because my previous iPads were wifi+cellular models (even though cell is usually turned off and at one point not even subscribed to a service)?? The mini is my first wifi-only iPad. Might the two have different behavior when connected to wifi?
It appears some of you don't want to believe that my previous iPads stayed connected to wifi when in lock mode, but 2.5 years of daily use tells me otherwise.
(I will say however that my iPhone 5, unlike 4 and 4S, does seem to disconnect from wifi but at least that has LTE as backup).