As other posters have mentioned, both Skyhook and Google maintain proprietary databases of location information for WiFi SSIDs and cell tower IDs. I believe Geomena is trying to start an open database of located IDs, but that it doesn't yet have the breadth of coverage that the proprietary competitors have. Google also provides a simple client-side JavaScript interface for IP geolocation (called ClientLocation), which might be just accurate enough for some applications, and a wide variety of IP geolocation databases exist.
If your application is web-based, you can take advantage of the W3C Geolocation API, which abstracts away the particular geolocation technology and provides your website user-controlled access to whatever geolocation method the browser chooses to use. On the iPhone, Skyhook's database is used to locate the phone with cell tower or WiFi or GPS location; Firefox uses the Google Location Service, which uses WiFi triangulation and falls back on IP geolocation.
Using some abstraction layer (like the W3C API) can have real advantages if you want your application to work across different platforms which have their own location methods, if you want your application to degrade gracefully when only rough methods of geolocation are available and you want your application to get the advantages of additional precision as your customers upgrade to devices with GPS technology.