Oh Keychain! Why art thou trouble?
At the apple support article titled Mac OS X v10.6: “The system was unable to unlock your login keychain” alert after logging in it describes how to fix a keychain issue.
The keychain has had a long and checkered history. Read The Key to Keychain: Effective use of Apple Keychain to get the fundamentals. Apple support helpfully suggests Using keychains with MobileMe, troubleshooting keychain issues
Some people have given up on the keychain and just use a third party utility called 1Password Password Manager and Form Filler 2.9.31 I don’t use either and I prefer to just memorize things. Whatever floats your boat.