I learned the following a trainer I worked with who knows more about nutrition than most, and who has discussed this with scientists. I also heard this from others, plus contradictions. I can't guarantee any of this. Parts of the following are good for me, mainly taking whey protein isolate after my work out.
Take a protein shake as soon as you finish (your last rep) of your work out, preferably immediately, or less than 45 minutes post work out. Protein taken 45 minutes or later after your workout purportedly will not matter any more than taking protein anytime, and will not show the benefits of the following.
For a short period (ASAP, or less than 45) immediately after your last rep of your workout, your muscles are most responsive to healing, which assists growing, that is provided protein. Whey protein isolate digests fastest and is preferred for this type of use, as contrasted with taking proteins that digest slower (the best of which are food such as lean meats, fish, eggs, so forth). Whey protein concentrate (right word?) is not slow, but digests slower than whey protein isolate. Casein (best is cottage cheese), I am told, sticks together and forms a...glob...of casein protein in your stomach, so it digests slowly over hours. Casein protein is not what to take post work out, if following this system.
You can add carbs (if good for your body make up, condition and goals) which digest quickly but not garbage like candy bars. Check your labels to find the right amount of carbs from whole organic juice (blueberry, raspberry, so forth) that does not contain added sugar. Or eat an apple, or half of an apple, or unsweetened applesauce is easy and quick. (Nutritionists and scientists can argue about these carb details, sugar, and this whole subject.) I have been told to leave out fat (good fat) from this immediately after work out shake, so it does not slow down the digestion of the protein. I used to add almond butter or eat a lot of almonds because I wanted the nutritional balance and quick though not that quick digestion (for blood sugar and insulin health). I do my post work out shake and nutrition differently today, though I still take my when protein isolate as part of my protein, to get nutrition fast to my muscles post work out.
A small amount of protein, carbs, good fat an hour before your work out will give you balanced nutrition for energy.
I have heard of people drinking protein during work outs, which I would think is good and bad for the reasons discussed by others. Gives your muscles more healing power at a peak time, though pulls some of your blood from your body and muscles to your stomach to digest. Drinking water during your work out is important.