There is a lot to consider undertaking an upgrade and much to regret if you get it wrong. I have four iMacs dating from 2006 OS 10.7 to present day and know the pitfalls of upgrading without the careful consideration of OS and application compatibility.
Your iMac can be upgraded to 10.13, (High Sierra) but you will need consider if you wish to access and run legacy applications.
If you are able, backup all applications to an external drive or suitable storage.
My workflow has always been to partition the hard drive into two or three partitions, if it has the capacity, keep the Lion OS on one and then instal any other OS on the other partition/s. That way you can experiment with OS and application compatibility.
Always make a bootable OS on a USB for future reinstall if things go wrong. The same OS can be reinstalled any time without backup.
If you need any more info, just reply.
David.