There is a concept called the "anabolic window", which is a belief that directly after a workout our body is primed for optimal muscle protein synthesis (muscle growth) and that this period lasts only a short while, with anything after that far less effective. When I say a short while, I mean on the scale of half an hour or so. There is however no sufficient scientific support for the idea that there is indeed such a window, rather than a prolonged period of increased muscle protein synthesis that gradually decreases back to base level over the course of days after a workout.
One of the reasons for this belief is that strength training causes some muscle damage, and as such muscle protein breakdown. To immediately counter the effects of this and prevent further breakdown, it is suggested that some protein, and carbohydrates to elevate insulin levels (of benefit to muscle protein synthesis) is consumed immediately after a workout. As stated before, the evidence doesn't seem to support this logic, and the breakdown is in fact greatly exaggerated in the minds of those who believe that nutrient timing plays such a large role. Breakdown may be greater, however, when training fasted; for example, when training first thing in the morning after a night's sleep and without breakfast. In that case it may be of some use to consume some protein and carbohydrates sooner after a workout. For reasons such as this, the term "peri-workout nutrition" has started popping up, to indicate that the nutrition surrounding a workout is of more importance than simply post-workout or pre-workout.
So if the anabolic window theory is disregarded, the question then is how long after a workout an increased protein intake is actually useful, and from what point on it only really serves to add calories and could be lowered. Going by a number of sources, you'll find that the consensus is something like this: muscle protein synthesis increases fairly rapidly after a workout (a time frame of hours), remains well elevated for around 24 hours and gradually tapers down. However, it may still be elevated above baseline for as long as 48 hours or more.
Practically speaking, if you train 3 times per week or more, you'll benefit from keeping protein intake high throughout the entire week. Even during periods with less or no additional muscle protein synthesis a high protein intake would be useful for those who do strength training or aim for a better physique. Sufficient protein will limit muscle breakdown. Protein also has the highest thermic effect of the three macronutrients, making it useful for satiety while trying to limit weight gain.
The conclusions are that increased protein intake will be useful for at least 2 days after training, that with a training regime of 3 or more sessions per week there's little point in varying protein intakes over the course of that week, and that it's useful to make sure you've got sufficient glycogen stored through carbohydrate intake in day leading up to a workout.
Alan Albert Aragon and Brad Jon Schoenfeld did an nice review of related scientific literature in this article: https://jissn.biomedcentral.com/articles/10.1186/1550-2783-10-5. It can be useful if you want to dig deeper into the available information.