Whenever multiple incarnations of The Doctor inhabits the same timeline it is a paradox that is corrected as soon as they leave. At the end of The Day of The Doctor the War Doctor has this exchange with Eleven:
WAR DOCTOR: I won't remember this, will I?
11th DOCTOR: The time streams are out of sync. You can't retain it, no.
Therefore we have to assume that the presence of all the other past incarnations of The Doctor that joined the three in executing the plan to save Gallifrey was also out of their proper timelines and once they left the events would not be part of their memories or history and therefore does not need to be "placed" in their timeline.
The inclusion of the Twelfth Doctor in this scene - a future generation - is more problematic to explain given the above. Unlike the others who were plucked from the past and brought into the present Doctor's (Eleven) timeline, technically it is the Twelfth who should retain memory all of these events and not Eleven! But perhaps it depends not on who is the "latest" generation but on who the critical events centre around. The Doctor is said to only meet himself in "times of crisis", and the story in this episode did centre around Eleven's discovery of the painting. Also, the final scene took place at the fall of Gallifrey which was really the War Doctor's timeline. So perhaps Twelve simply responded to the call across time to help with this "crisis" and then the timeline reshaped around Eleven because he orchestrated it.
The short answer to your question then of "when" Twelve left his timeline to go and help out in the events of Day of The Doctor is that he didn't. His appearance there was, just like the appearance of Ten and other previous incarnations, a paradox which would have been corrected and ceased to be part of their normal timeline. In the cases of past incarnations it as if it never happened; in Twelve's case, it is as if it would never happen, so there would be no reason for the event to be written into subsequent storylines.
If you want to take a guess at when in his 3-year run it might have occurred the only clue is his shorter-haired appearance which is more consistent with how he looked during his first season. Capaldi's hair got notably longer each season. However, this is in conflict with the explanation for the Fifth Doctor's older appearance in Time Crash:
"The two of us together has shorted out the time differential. Should all snap back in place when we get you home."
Therefore the Doctor's appearance and apparent age during any situation when he meets himself cannot really be used as a guide to which era they came from.
Out of universe, the inclusion of Capaldi in this sequence was probably just a gratuitous way of getting viewers excited about the coming regeneration and possibly done without much thought. Also, the short-haired appearance would have reflected the time of the filming and is unlikely to have been part of a plan to place the event in his future timeline.