Let $a$ be a nilpotent element with degree of nilpotency $n$ in $R$, and $r$ be any other element in $R$.
It cannot be that $ar$ is a unit, for if $ar=u$, then $0=a^nr=a^{n-1}u$, but since $a^{n-1}$ is nonzero by assumption, multiplying it by a unit would be nonzero too. Therefore $ar$ is nilpotent. It follows that $1-ar$ is a unit for any $r$, and by a well-known characterization of the Jacobson radical, $a\in J(R)$. So $J(R)$ contains all the nilpotent elements, and consisting of nonunits itself, it is a nil ideal, so it is in fact equal to the set of all nilpotent elements.
By another well-known exercise, when the nonunits are closed under addition (as is the case here, the nonunits=nilpotents are closed under addition), $R$ is a local ring.
So the characterization is: $R$ is a local ring with nil Jacobson radical.
For commutative rings the situation is slightly easier, because you get that the nilpotents form an ideal for free.
Moreover, in such rings, is invertible if and only if 1− is not invertible.
That isn't true though. For $R=F_3$, $2$ is invertible and so is $1-2=2$.
What is true is that at least one of $x$ and $1-x$ is a unit (this is another way to characterize local rings.)