Phosphorus is element number 15, so the P atom has 15 protons and 15 electrons
for a total of +15 + -15 = 0 charge
P-3 has a charge of -3 because it has attracted 3 electrons off a less electronegative atom.
Now, the P atom has 15 protons (+15) and 18 electrons (-18) which = -3 net charge on the P-3 ion.