How long before or after you workout should you consume protein foods?

I’m looking to gain a little weight that’s why I’m asking.