Here's how to figure that out:
* Silver has a +1 charge (Ag⁺)
* Nitrogen has a -3 charge (N⁻³)
To balance the charges, you need three silver ions (3 x +1 = +3) to combine with one nitride ion (-3).