You can upgrade through the App Store. But Sierra won't run well on your machine due to the hard drive. If you swap that out for an SSD, she'll run better than new and is more than capable of running the latest OS.
Your 2008 model will not run Sierra, new hard drive or not. Suggest going to the App Store and upgrading to El Capitan OS X.11. Your current operating system is no longer supported by Apple with Security Updates which can present a real problem with 'net security, dealing with banks etc.
Both the 20" and 24" iMac can handle up to 6GB of memory, 1 x 4GB and 1 x 2GB despite what Apple said about the 4GB max. at the time of release. Well worth the upgrade.
This is my opinion only, but you really don't want to run anything past 10.8.5 on an older iMac with only a platter-based hard drive.
The newer OS may run, BUT… the user experience will be more like the OS is "walking", instead of "running", if you get my drift.
Perhaps it's time to start shopping for something newer…