On the note, we don’t know where Hook was staying. He could have gone back to where he was staying before showing up again at Emma’s apartment the next morning.
But an even funnier scenario, would be that he never left. Like maybe he camped out outside her apartment the whole time and waited until both her and Henry woke up to at least have breakfast together and then make his entrance.