He definitely warged into Hodor while they were still in the cave.
When the White Walkers arrived Hodor was terrified and wasn't reacting when Meera asked him to move Bran.
This caused her to try to wake up Bran:
Warg into Hodor now! Bran, wake up.
We need Hodor.
We need Hodor.
Warg into Hodor now!
After that the Three-Eyed-Raven says:
Listen to your friend, Brandon.
and Bran wargs into Hodor which can be told from the fact that we can see the whites of the eyes of the latter for a brief second. Immediately after that Hodor grabs Bran's sledge and they start escaping.
It seems that we cannot tell for sure if Bran was still warged when Hodor was holding the door, but since there was no sign of Bran leaving his body he most probably was.
Additionally, according to GoT Wikia Bran warged into both present-day Hodor and young Hodor:
Bran hears Meera's cries to warg into Hodor and the Three-Eyed Raven
tells him to listen to her. Bran wargs into both the Hodor in the cave
(present day) AND the Hodor in his vision (past).
If this was the case then young Hodor's epileptic seizure was due to Bran being warged into him. Since it was still occurring when present-day Hodor was holding the door it would mean that Bran was still warged in both of them.