Sierra should be fine, but that will depend somewhat on the condition of the internal drive. Three questions to ask:
1. Have you ever done any disk cleanup/maintenance/repairs, from a software perspective? You can actually do quite a lot of disk cleanup on your own, and there are some excellent products available (both free and commercial) that can help you with that.
2. This is
critical: Are you making backups to an external device? If you are (hopefully) doing that, what software do you use for that task?
3. Do you know if your iMac has its original hard drive inside?
By the way, is this your Mac:
https://everymac.com/systems/apple/imac/specs/imac-core-2-duo-2.4-24-inch-aluminum-specs.html
If you decide to upgrade to Sierra, it would be best if you do a clean installation. That will definitely require a backup. And a backup made with either SuperDuper! or Carbon Copy Cloner would be the way to go.
Additionally, you'll need to take an inventory of any third party (ie. non-Apple) software you are using. Some/most/all will need to be upgraded to be compatible with Sierra/