I am having the issue as well. I just got my S4 a week ago. I am on VZW and I have a ASUS RT-N66U router. I tried most of the tricks mentioned here (and some others) without any luck.
I connect fine, stay connected for a time (sometimes for a while, sometimes only for minutes), then it loses connectivity. I can toggle wifi off and on to regain it immediately, or just wait it out, but this really is an issue.
It is a frustrating, grating issue on a phone I just love otherwise. What a shame, and what a pain! I hope there is some upcoming update to address this, though given how sporadic and inconsistent the problem seems to be, I am not very confident one is forthcoming ...