I think this is some kind of continuity equation.Its considering a region of space with some charge inside it.Because charge can't be created or destroyed,the only thing which can cause the amount of charge to change is a current and so we should have a surface integral of current density.But because we're interested in a region of space,the surface is the one enclosing that region which is of course closed.