We need to know how your network is configured.
I guess you have a router and this is set as DHCP. This will get an IP automatically and configure things like DNS, Gateway ect.
If this is correct then look at the DHCP address pool, make sure you have enough, also lease times could be to long.
If like my house you have multiple WiFi AP's, and routers you may have a DHCP server conflict, make sure only the DHCP server on your network is the one that has the connection to the ISP, this helps reduce issues.
Now the obvious, make sure you have a good cables, or WiFi radio quality. make sure its connecting to the correct WiFi AP. And if you are still having issues, turn off the security on the WiFi AP. If it is ok with no security you most likely have the wrong security key.
hope that helps./