I've been strugling with the same issue the past weekend.
So far I've come to the following conclusions:
1) for me, it's definitely a wifi issue. If I reboot the phone, it will freeze in a matter of minutes. If first thing I do is turn off the wifi, or at least disconnect from my home network (but leave wifi turned on), it will not freeze at all, and it will run stable for hours on end. Seconds after I re-enable (or re-connect) to wifi, the phone will freeze.
2) for me, it seems to be a 4.1.2 issue only. I've tried different (stock) ROMS (XXEMR2, XXELLA), and all the 4.1.2 ROMS were freezing. Even during initial setup after factory reset (not long after connecting to wifi). I flashed back to the original 4.0.4 (XXALF5), which seemed stable. I tried Emergency Recovery through Kies (which installs 4.1.2 XXELL4), but that one frooze too. I've now flashed it to a 4.1.1 ROM (XXDLIH), and been working on the phone intensively for the past 2hrs restoring all my apps and data, continuously on Wifi, and it hasn't crashed once.
So even though, at least for me, this seems to be limited to the 4.1.2 firmware only, I'm still debating if I should just let this slide. Maybe it IS a hardware issue, that's being triggered by 4.1.2? If so, since my phone is still under warranty for the next 4 months, would it be safer to send it back and have it checked?