By default iPhone will use wifi first then try 3g, then Edge. You can turn on airplane mode on then wifi on to prevent the phone from trying a cell connection, though you shouldn't have to do so (and you won't be able to recieve calls).
If your phone isn't maintaing the wifi connection when you try to use the internet it suggests your home network isn't confgured correctly to share Internet.
The manual can be downloaded a a PDF from the apple site in the support area by the way.