Never, ever, use WD-40. It will dry out your chain. Use a light lubricant like Tri-Flow. In general, chains get dirty but their function isn't compromised. I force myself to wait until the chain is bone dry from use before applying the next layer of lube, because frequent cleaning and lubing can actually make your drivetrain more gungy over time.