Currently it doesn't seem that it is possible to close ports on demand:

You mean to not expose or to stop the process?
You mean to not expose or to stop the process? -- @svenefftinge
i'm not sure what you mean so:
If i expose a port i want to have the ability to change it's status on not exposed on demand
It would also be a nice feature to expose ports on runtime where gitpod only allows to expose 5900 and 35900 by default where adding additional ports i not possible unless something outputs in them.
We are going to change this soon so that the 'unexposed' state means: only accessible to users having access to your workspace. That is only you unless you have shared the running workspace.
'Exposed' means accessible publicly (without need to login, etc.).
And with that it will be possible to change the un-/exposed state in the ports view, of course.
Assuming reporter-feedback-needed i find that as a sufficient solution.