First check to see if your system meets the system requirements to upgrade.
Lion system requirements are:
- Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
- 2GB of memory
- OS X v10.6.6 or later (v10.6.8 recommended)
- 7GB of available space
Mountain Lion and Mavericks requirements are the same, as listed here: http://support.apple.com/kb/HT5842.
If you can run Mavericks, you can download a free upgrade from the Mac App Store. If your system can only run Lion, you can go here to purchase a redemption code to download it from the Mac App Store. If you prefer Mountain Lion for software compatibility reasons, you can go here to purchase a redemption code to download it from the Mac App Store.
After upgrading, you will find iCloud in System Preferences>iCloud on your Mac, and can set it up as explained here: http://www.apple.com/icloud/setup/mac.html.
Before upgrading, you may want to check the compatibility of your existing applications by checking here: http://roaringapps.com/apps:table. Also be aware that older PPC programs such as AppleWorks and Office 2004 for Mac will not run on OS X Lion or higher.