Unfortunately the set of nilpotent elements does not always form an ideal for noncommutative rings.
Nil ideals are still associated with interesting open questions, especially the unsolved Köthe conjecture.
Therefore, the set of all nilpotent elements forms an ideal known as the nil radical of a ring.
Furthermore, for any nilpotent element a of a commutative ring R, the ideal aR is nil.
In fact, this has been generalized to right noetherian rings; the result is known as Levitzky's theorem.