Whenever the coach wants to pinch hit for a player. Each coach is different. I've had coaches who would tell players in the dugout before their half of the inning started. I've seen coaches relay it to the dugout from the third base box 3 or 4 batters ahead of time. I've seen coaches wait until the batter is in the on deck circle. I've seen coaches make the change as the batter is walking up to the plate. I've seen coaches call kids back from the batters box as they're stepping in. It depends on the situation in the game, was there a pitching change, runners on, how many outs, was there a better contact hitter on the bench, was coach planing scenarios (ie...if so and so gets on, so and so is going to hit)? Better yet, was the score lopsided and the coach was trying to get players at bats who normally don't get any? I've been in that situation as a coach where it took me until the last second to realize a player hasn't been in yet, and/or couldn't decide who to get an at bat until that last moment. It makes for an unhappy player (I've been pulled in games for what I considered to be no good reason, only to talk to coach later and find that he was thinking about the team 2 weeks from now and getting some guys an ab now so he was ready if we needed him down the road) but is something that is part of the game, no matter when the change is made. If the player has a problem with this, he needs to ask his coach why the change is being made. There's probably a good reason for it and the player needs to make the effort to find out what that reason is, and knows what he might have to work on to get that ab instead of being replaced.