Tom's last day in the office is Monday. From Tuesday he will be a pensioner. His working day is 8 a.m. to 5 p.m.
When will Tom leave his job? On Monday, probably strictly speaking at 5 p.m.
When will Tom have left his job? He will have left his job by Tuesday morning, in fact probably by just after 5 p.m. But you could also say that he will probably have left his job on Monday at 5 p.m.
So the two are not logically the same but in this particular case they may come to the same result because leaving your job could be said to happen in an instead.
Consider therefore a different example:
Tom will be going on an ocean cruise after he retires. The cruise will last from March until May. While on the cruise he will paint a portrait of his wife.
When will Tom go / be going on his cruise? From March to May.
When will Tom paint a portrait of his wife? While he is on the cruise, from March to May.
When will Tom have gone on his cruise? By the end of May.
When will Tom have painted a portrait of his wife? By the time he gets back from the cruise, around the end of May.
To be honest though, we don't use these "when will have" type questions very much (with the future perfect tense), except in special situations such as if we really want to emphasise the completion of something to be ready for something else, e.g. "when will you have finished your homework by, so we can go to the cinema?"