The capability of an atom to gain or lose itvalence electrons in order to complete it's valence shell ( last shell) is known as valency.
For Example,
SODIUM
ATOMIC NUMBER- 11
ELECTRONIC CONFIGURATION- K-2,L-8,M-1
Atom of every element wants to have eight electrons in it's valence shell. As you can see above sodium has one electron in it's valence shell. In order to get a completely filled outermost shell it has to lose this one electron. So, it will have a valency of 1.