Then Satan entered Judas, called Iscariot, one of the Twelve. And Judas went to the chief priests and the officers of the temple guard and discussed with them how he might betray Jesus. They were delighted and agreed to give him money. He consented, and watched for an opportunity to hand Jesus over to them when no crowd was present.
As soon as Judas took the bread, Satan entered into him. "What you are about to do, do quickly," Jesus told him.
If evil spirits can enter and come out of a person at will (Lk 11:24-26), surely Satan can. Judas was already going against Jesus and his teachings of his own accord (c.f. Jn 12:4-6), so Satan didn't need to be continually residing in him for him to betray Jesus (though he did influence Judas at critical moments).