You have to be careful when you ask about a "closed condition", because the questions is "closed in what"? E.g. the plane curves of given degree admitting at worst nodal singularities are not closed in the linear system of all plane curves of that degree. (Consider e.g. the family $y^2 = x^3 + t x^2$, where $t$ is a paramater; this is a nodal family (when $t \neq 0$) which has a cuspidal curve (at $t = 0$) as a limit.)
The key fact which justifies the definition of stable curve is the semi-stable reduction theorem, which says that any family of smooth projective curves over the punctured open disk (or more generally, over the fraction field of a DVR) can be extended to a semistable family over the unpunctured disk (or, more generally, over the DVR) after making a finite base-change.
Here semistable means that every geometric singular point in the fibre over the "filled-in point" (which I'll take to be $t = 0$, where $t$ is the coordiante on the disk,
or more generally the uniformizing parameter in the DVR) has a formal neighbourhood isomorphic to $x y = t$.
This is a fundamental theorem, which takes time and practice to understand, and which is closely related to resolution of singularities: indeed, you an always extend the family of curves over the puncture in some manner (e.g. by closing up in some ambient projective space), and you can think of semi-stable reduction as telling you that you can resolve the singularities in the total space of the resulting family in a particular way, so that they are well-adapted to the projection map to the disk.
E.g. Imagine that locally you had the equation $x y = t^2$, which is smooth over $t \neq 0$, but has a singular fibre over $t = 0$. This is not semistable at $t = 0$ (the point $(0,0,0)$ is a singular point of the total space of the family, whereas the total space of a semistable family is smooth), but if you blow up the total space of the family at $(0,0,0)$, you can check that what you get is now semistable (and since the blow-up is occuring in the fibre over $ t = 0$, nothing changes along the smooth family where $t \neq 0$).
E.g. Consider the equation $x^2y = t$. This is not semistable: the fibre over $t = 0$ is non-reduced, whereas the singular fibres of a semistable family are always reduced. To make it semistable, we first base-change to the disk $t = s^2$, to get $x^2y = s^2$. We then normalize (this doesn't change anything when $s \neq 0$, because the fibres, and so also the total space, is smooth there and hence normal): since $(s/x)^2 = y$, we find that $z:= s/x$ is well-defined on the normalization, and satisfies the equation $x z = s$; thus we have now obtained a semistable model.
In general, you have to alternate blow-ups and normalizations (after ramified base-changes) to obtain a semistable model.
The semistable reduction theorem implies that the moduli stack of stable curves is proper (the fact that we might have to make a base-change of our DVR reflects the stacky nature of the situation).
General remarks (maybe these should have come first!):
We know that moduli stacks of smooth objects are not proper, so to obtain proper moduli stacks, we have to allow some sort of degeneration. Semistable degenerations are a natural class of explicit and simple singular degenerations which give rise to a proper moduli stack.
Note that there are another class of singular degenerations which sometimes work well, namely those with isolated quadratic singularities (this is the theory of Lefschetz pencils). These coincide with semistable degenerations in the case of curves (which is what your question is about).
Both semistable degenerations and Lefschetz pencils behave well with regard to understanding the behaviour of cohomology in the family (this is Picard--Lefschetz theory in the second case, and the Rapoport--Zink spectral sequence in the semistable case). Deligne uses Picard--Lefschetz theory in his proof of the Weil conjectures, but semistable degenerations are often more natural from a motivic point of view.