Normally you are supposed to validate your mesh before going on with rigging and skinning, because editing the mesh can break things down the pipeline, including the rigging and skinning. So, especially if you are working with other people, make sure you are not doing anything destructive.
IF the gaps are not supposed to exist within the mesh and revealed only when moving mesh parts around I.E. if they are unintended overlapped vertices, then the easy fix is to select the overlapped vertices and hit M → merge by distance. This will break the vertex weights on the selection, so it will need rebuilding afterwards, but it will get rid of the gap.
Otherwise, probably the best option is to not edit the mesh itself, but instead make sure to make the weight assignment in a way so that the overlapped vertices don't dissociate from each other. For that, it's actually quite straightforward : make sure they have the exact same weights from every vertex group they have assigned to.