First follow instruction from Apple's website to login to your iCloud account.
Then open Keys.
Click the gray cloud icon (This is the switch to toggle iCloud sync on and off) on the top right of the window:
After you click the button, it will show the enable iCloud Sync dialog:
Click "Enable iCloud" button.
After you enable the iCloud Sync, Keys will check if there exists password database file in the iCloud since you may have already synced data with iCloud from your iOS device before.
If Keys is able to find your database file in the iCloud:
Keys will just use that file. Keys will skip the password setup window and present you with the login window:
You are all set. After this point, your data will be synced automatically in the background.
Sometimes, even if you have database file in the iCloud. Keys may still not be able to find that file temporarily since it takes time for iCloud to transfer data to local disk. In this case, Keys will think there is no database file in iCloud and will ask you to create a new master password. Don't panic, you can just go ahead and create the same master password as the one stored in iCloud. When iCloud finishes syncing the database file to local disk. Keys will automatically merge your iCloud data with your local data.
If you actually don't have database file in the iCloud:
Keys will ask you to upload the file to iCloud shortly after you unlock the window:
Since you have never uploaded data to iCloud, click 'Upload data to iCloud'. After this, you are all set, Keys will sync data automatically in the background afterwards.