In Deathly Hallows, when Harry, Ron, and Hermione are at No. 12, Grimmauld Place, Harry summons Kreacher from the kitchens at Hogwarts where the elf has been working on Harry’s orders given a year previously.
When the trio’s heist in the Ministry of Magic ends with Hermione inadvertently bringing Yaxley inside the perimeter of the Fidelius charm that protects Grimmauld Place, the trio leg it and dare not return there for fear that it’s now crawling with Death Eaters.
Before they leave for the Ministry in the morning, Kreacher is talking about making a stew or pot roast or something for dinner. After the trio go on the run and camp out in the tent, Harry thinks of poor Kreacher preparing a dinner they’ll never return to eat, but they dare not summon him lest a Death Eater tag along (like how Dobby ‘tagged along’ with Kreacher when Harry called him to have him follow Draco in Half-Blood Prince).
The next time we see Kreacher is during the Battle of Hogwarts where he leads the house-elves from the kitchen with battle-cries of “For Master! For Harry Potter!” (or something like that), so he’s clearly lost none of his new-found loyalty to Harry.
Harry is still Kreacher’s master throughout the book, and since he does not communicate at all with Kreacher after their escape from the doorstep, he cannot have ordered Kreacher to return to Hogwarts to work there again.
We know that house-elves can go against their masters’ wishes, but this usually entails them punishing themselves rather brutally, and Kreacher does not seem to have been constantly injuring himself for the better part of a year at Hogwarts.
So when and how does Kreacher leave his master’s house without orders and return to Hogwarts?