If you're buying one new from Apple, it'll already have iOS5 installed.
If it hasn't got it installed, it's easy enough to update when you sync the iPad (though it's best to do this on a home network; corporate firewalls can cause problems).
Re the iCloud - you'll also need to upgrade to iTunes 10.5 (if you haven't already), and there are certain OS requirements for your computer: Macs need to be running OS X Lion 10.7.2, while PCs need either Windows 7 or Windows Vista Service Pack 2 plus the iCloud Control Panel for Windows.