After sleep, Messages doesn't consult Keychain for passwords
Try: 


Disk Utility to verify volumes and repair permissions on the startup volume, then Keychain Access to verify or repair the keychains
run Messages
sleep then wake the computer
if the problem persists, remove relevant items from keychains then allow Messages to replace the items.