if yours is a PPC (G4 or G5) iMac you can upgrade only as far as Leopard 10.5.8, which on eBay or Amazon can cost up to $200.
If yours is an Intel based iMac you can go directly to Snow leopard 10.6.8:
Start by checking if you can run Snow Leopard:
Requirements for OS X 10.6 'Snow Leopard'
(NB: PowerPC applications can still be run in Snow Leopard using Rosetta, but they will not work in later versions of OS X.)
The OS 10.6 Snow Leopard install DVD is still available for $19.99 from the Apple Store:
and in the UK:
but like Leopard, Snow Leopard is no longer supported by Apple in terms of security updates.
When you have installed it, run Software Update to download and install the latest updates for Snow Leopard to bring it up to 10.6.8, or download the combo update from here:
Check via Software Update whether any further updates are required, particularly to iTunes (you will need the latest version in order to synch with mobile devices).
You should now see the App Store icon in iTunes, and you now need to set up your account:
I think nobody seems to have paid attention to your signature saying it is a 2007 iMac. Those can be upgraded to a minimum of 10.7.5 per the hardware.
Though since you are running 10.6.8 or earlier, you'll have to read this tip to determine the path best for you in terms of compatibility of software:
You can go as I say in the tip from 10.4.11 to 10.6 for $20. You can then get to 10.6.8 for free once you have 10.6 installed,
and then you have to determine when in 2007 your iMac was made to see if it is compatible with 10.8 or later.