The iCloud Keychain feature of your Mac to manage the usernames and password of online and social accounts. It can encrypt and store the credentials of your online accounts, sync your credentials across your Apple devices (Mac, iPhone, iPad and iPhone Touch) and generate passwords when signing up/registering to new services in Safari. Here's how to Enable the iCloud KeyChain on you Mac:
Click on the Apple menu > System Preferences > iCloud. Sign-in with your Apple ID. Tick the Use iCloud for mail, contacts, calendars, reminders.. checkbox and click on Next. At this point you will be prompted to create a password to unlock your screen (unless you have already set up a password to wake your Mac from sleep).
Back to the iCloud menu, tick the Keychain checkbox. Enter your Apple ID and follow the onscreen instructions.
NB: The iCloud Keychain works only with Safari and won't create or save password for other browsers such as Google Chrome, Firefox...