You can either download apps to your iPhone directly, or you can download them to iTunes on your computer and sync them over.
If you want to download them directly onto your iPhone, you can do it over the 3G network (cell network like AT&T) or via a WiFi connection (your own personal wireless router at home, or at a WiFi hotspot at Starbucks or something).
On the 3G cell network, you can only download apps smaller than 10MB. If you want to download apps bigger than that, you need to be on the aforementioned WiFi connection.
You can connect your iPhone to WiFi the same way you would your computer (laptop or desktop):
Settings > WiFi
Find your router, choose it, then type in your WiFi password and you should be good to go.