According to Apple, you should be able to upgrade to 10.6.8 if your iMac has an Intel processor. Apple shifted to Intel processors (from Motorola) for the iMac line and for newer versions of OS X, and Intel is required to run 10.6.8 and later.
When you bought your iMac, it obviously came with the newest version of OS X at the time – 10.5 – though you may have done some updates to get it to the last update available for 10.5, which is 10.5.8. Snow leopard 10.6 is a major release, so installing it will completely delete 10.5, but it won’t delete any of your own user files and applications, because installing 10.6 will do an “archive and install” and keep all your own files safe during the 10.6 install.

About This Mac info box (your iMac info will be different)
To do an archive and install, you will need to boot from and run the iMac from the installer DVD, but when you buy a 10.6 DVD, it will come with instructions on how to do that. You still may want to make a backup copy of important files or even copy the entire hard drive to an external USB drive.
On your iMac, look under the Apple menu and select “About This Mac….” That information box will tell you if your iMac has an Intel processor and if you will be able to install 10.6. Read the first part of the Technical Specifications for Mac OS X v10.6 Snow Leopard at Apple and check your iMac.
And you can still order a 10.6 install DVD from Apple at this page: Mac OS X 10.6 Snow Leopard – Apple Store (U.S.) for $19.95.
If you do go to 10.6, after the install and after the iMac restarts, go ahead and run Software Update several times to get all the different updates that have been released since 10.6 was new.
Be sure and do that, because many bug and security fixes have been released and your iMac will run better and you will be safer, too. You will need a DSL line or better to run Software Update, because the updates are large and will take an hour or more to download, even on a fast connection.