When a deceased man has his work done in the temple, when does he get the priesthood?
Thanks for your question.
When we do vicarious work for the dead, the first step is to have the individual baptized, then confirmed. Deceased males are then ordained to the office of elder in the Melchizedek Priesthood, since men are required to hold the Melchizedek Priesthood before receiving the higher covenents of washing and anointing, endowment, and sealing to spouse. Sometimes it happens in the same room/time if time permits. Other times, it is done separately by a completely different set of proxy workers.
If you’re asking at what specific point a deceased man who has his proxy work performed actually receives the Priesthood, we are not told the specific mechanics of how such things work. Without knowing the nitty-gritty specifics, we may safely assume that a worthy deceased man in the postmortal spirit world receives the Priesthood when the proxy ordination is performed, or at the point where he becomes worthy and prepared to accept such an ordination.