I too am experiencing the same thing, though I have figured out a temporary solution.
The problem appears to be when connected to a WPA/WPA2 personal encryption/security enabled WiFi network. I'm not sure if it's the hardware or software of the iphone 5 itself, but it's clearly busted on a security enabled network.
What I did for a workaround was create a guest network that is open with no security. Oddly enough, my iPhone 5 stays connected and continues to work as expected on WiFi.
If I re-connect to a WPA/WPA2 personal encryption/security enabled WiFi network, it will work for about 1 or 2 minutes and then appear to hang when it comes to downloading data. A reboot of the iphone or even going into airplane mode and back out of airplane mode will fix it temporarily until it once again hangs.
It consistently works on an open or on a non WPA/WPA2 security enabled network, but I can't answer why.
For what it's worth, my other IOS 6 devices work fine, so it must be the way the software is handling the hardware of the iPhone 5, but tagain, I can't answer that definitively.