If you are having WiFi problems it is necessary to isolate whether the problem is with your network or your iPhone. Note: Do NOT consider your network to be blameless if some other devices can connect to it.
First, test your iPhone on some other networks: a friends, Starbucks, Barnes & Noble, etc.
If it works well there then the problem is with your network. Try restarting your router by removing power for 30 seconds. If that does not help check for a firmware update for your router. If none exists which corrects the problem contact your supplier.
If your iPhone does not function well on other networks it possibly has a hardware problem. Contact Apple Support or visit an Apple store for evaluation. They can provide a replacement if your iPad is bad.
Also look here: http://www.apple.com/support/iphone/wifi/