You didn't say where you need to upgrade to, or for what ... so here's the path to get you current.
First, install OS X 10.6. This is available from the online Apple store, which in the US is at 800-MY-APPLE or online here. See this article on installation considerations. Ensure you have have a solid,bootable, backup before you start. Plan to erase and install then transfer files from your backup.
After you install OS X 10.6 and do Software Updates, you'll be at OS X 10.6.8. From here you can upgrade to either OS X 10.7 Lion or, assuming your iMac is a mid-2007 or newer model, to the current OS X 10.8 Mountain Lion. Unless you have a reason to upgrade to Lion, you should probably go straight to Mountain Lion. Note, both Lion and Mountain Lion have a minimum memory requirement of 2GB, which you have, however, 4GB is recommended.
You can order OS X 10.7 Lion from the online Apple store, which in the US is at 800-MY-APPLE. You can download OS X 10.8 Mountain Lion directly from the App store (you'll have the access program on your OS X 10.6.8 system). You can go directly from OS X 10.6 to OS X 10.8, you do not need to install OS X 10.7 as an intermediate step.
If you have any PowerPC programs, they will no longer work under OS X 10.7 Lion or OS X 10.8 Mountain Lion. Some were surprised when Microsoft Office 2004 no longer worked after the conversion.