The lack of knowledge in this thread is astounding. Mainly the guys who think protein is for energy. Why do you think people on ketogenic diets have no energy? Because protein and fat are less efficient energy sources than carbohydrates.
Protein shakes are merely a powdered form of protein. I'm assuming you have whey protein, which can be taken at any time of the day, it's simply a food substitute. However, whey is best taken with water and simple carbohydrates immediately following a workout for the quickest digestion possible.
Other times of the day, whey is best taken with milk so the casein in the milk can coagulate with the whey in your stomach and slow digestion, providing a slower and more sustained release of amino acids into your bloodsteam.
This is assuming your goal is to gain weight, obviously. If you were looking to lose it then milk (because of the lactose) and post workout simple carbs are best avoided as they will serve only to spike insulin levels.
I'd also like to address chonky's point that nutrient timing doesn't matter at all. I disagree entirely. Cortisol levels will be sky high after an intense workout, and simple carbs and a fast digesting source of protein are really very important to get to optimise glycogen synthesis and protein synthesis in the muscle tissue. There is a "window of opportunity" for 2-3 hours after your workout you really don't want to miss. Personally I take in most of my carbs immediately after a workout. I have a tin of potatoes and 2 tins of baked beans (the potatoes to provide an insulin spike and blunt cortisol levels), then an hour later I have a wok full of stir fry with a lot of wholemeal pasta. I also have whey in water immediately after the workout with the potatoes and beans, and then a whey/casein blend with the stir fry to provide a steadier source of protein to my muscles for the next few hours.