Fetching details from the dictionary...
time of departure; (on the) point of departure; just as one is leaving
帰り際に、お土産を買い忘れていたことを思い出した。
At the moment of leaving, I remembered that I had forgotten to buy souvenirs.
部長が帰り際に私を呼び止めた。
My boss stopped me just as I was about to leave.
帰り際に、またねと手を振った。
As I was leaving, I waved goodbye.