Welcome to the asylum!
I'm pretty new here myself, but I think it goes like this:
On the movement phase you move from the other world to Arkham (usually onto a gate to the world you were in, but iirc some spells/effects can alter that). You place an explored marker under the character but do not close the gate yet.
On the Arkham Encounters phase, you can close the gate (as long as you haven't moved from the location). If you close it you can chose to seal it. If you only close but do not seal then you cannot seal that location later unless you explore and close another gate at that location.
If you move away from the location, you can no longer close the gate (you lose the explored token).
After returning from the other world, you can close the gate on your movement phase right?
No - it's sealed on the Arkham Encounter phase (as long as you haven't moved away from the location).
And after you have closed it, can you leave the gate and then come back later to seal it?
No - you have to seal in the same phase that you close.