You cannot open a new iCloud account on a pre-Lion Mac. If you are setting up an existing iCloud account on a pre-Lion Mac you will probably need to set up your email to the new iCloud server settings manually in any email application - this tutorial shows you how to enter your iCloud account settings in Apple Mail on Snow Leopard - the method for Leopard is basically the same. (The method is different in Tiger and is detailed here.)
If you still have a MobileMe account set up in Mail, go to to Mail>Preferences>Accounts and select it. Click the '-' button at bottom left to delete it.
Now click the '+' button to create a new account. In the first pane enter your name, email address and password. (If you are setting up a newly created iCloud account enter your @icloud.com address).
Apple are now requiring app-specific password for third-party applications to access iCloud if you have set up two-step verification (if you haven't set this up you can ignore this paragraph). Since Mail on Snow Leopard and earlier was not intended to access iCloud you will have to generate a password for it. Go to http://appleid.apple.com; click 'Manage your Apple ID' and sign in (you will be prompted for an access code sent to your trusted device). Select 'Password and Security'; click 'Generate an App-Specific Password' and follow the instructions. Once you have the password, copy it and paste it into the form shown below. You should also keep a note of it (though you can generate a new one if required).
If necessary hold the option (alt) key down to change the 'Create' button to 'Continue' (this is to prevent the 'Wizard' from setting up for MobileMe). You may not need to do this on Leopard if you uncheck 'Automatically set up account' (this checkbox does not appear on Snow Leopard). Click 'Continue'.
Choose IMAP, enter a description (e.g. 'iCloud'), and your User Name (i.e. your iCloud login - this should be there automatically). Set the Incoming Mail Server to imap.mail.me.com Click 'Create' (don't hold the option key down this time).
Enter the SMTP server address as shown and click 'Use Authentication'. With both servers Mail will contact the server to check that it can connect, and this may take some time. Click 'Create'.
This shows the summary of the details. Check 'Take account online' if necessary and click 'Create'.
The next step is optional; go to the list of accounts in the sidebar of Preferences>Accounts and select your iCloud account. If you also have an @mac.com address with the same username, or you have aliases, you can add them to the 'Email Address' field, separated by commas. They will appear as an option in the drop-down menu when sending mail. With a newly created account you will have only an @icloud.com address but you can also add any aliases you have created here.
Make sure the Outgoing Mail Server is set to 'iCloud' or whatever you named the account.
You should now see your iCloud account in the sidebar of the main Mail pane.
There may be an extra step necessary on Leopard. If you can't connect, go to Preferences>Accounts, select the account and click the 'Advanced' tab: set the port number to 993 if it isn't than already and make sure that 'Use SSL' is checked:
It's possible that you may get 'wrong password' errors: if so you should go to http://appleid.apple.com and change your password, making sure that it complies with Apple's requirements: at least eight characters, of which at least one must be a numeral and one a capital letter: the longer and more complex the better.
© Roger Wilmut. This site is not associated with Apple.