My, people sure are grumpy today.
WiFi connection issues are about the hardest to trouble shoot remotely, so don't take the dearth of useful comments (mine included) as a negative reaction. It's just hard to offer good suggestions on something that complex.
The iPad, both generations, has a history of problems with some routers. It's not super common, but can be very frustrating when encountered. Many people chose to go out and buy a newer router rather than try to figure out a good configuration for their current ones. I know, that suggestion isn't likely to make you feel better.
So the fist thing to do is determine if that's what is going on. The easiest way to do that is try the iPad with various free wifi hotspots and see if the problem persists. If it does, and no other obvious solutions present themselves then you should probably give Apple a call. Even Apple isn't immune to the occasionally lemon. If it's does only happen on your wifi, then you have some difficult choices. New router (research to be sure you get a known to work with iPad one), or play with your router and iPad settings until you can maybe get it to work. Google searches for iPad and the router's model number may, or may not, be helpful.
I know it is frustrating to have problems right out of the box, but give yourself little time to work things out. Nothing, even an Apple iPad, is worth raising your blood pressure.
Oh, forgot to mention. It never hurts to try the universal computer fixer. Restart the device. Give that a try first thing.
http://support.apple.com/kb/HT4057