Assuming that this is only a problem with your home network, try the easy stuff first: Reboot your router by turning it off for 15 seconds or so.
Next, if this doesn't fix it, on the phone go to Settings/General/Reset - Reset Network Settings. You will not lose any data, but will have to re-enter your WiFi passphrases or codes.
If you have a cordless phone near the router or iPhone try moving it, especially if it is a 26 GHz phone, as it may be causing interference.
Try changing channels on your router. Choose any channel except 6 or 11, which are the default channels for all new routers.
If the problem occurs with all WiFi networks, not just your home network, try the Reset Network Settings. If that doesn't fix it you probably have a failing WiFi chip and your phone needs to be replaced.