Elements with the same atomic number but different mass numbers are called isotopes. Eg.- Isotopes of hydrogen: Protium (A = 1), Deuterium (A = 2), Tritium (A = 3). This is because of presence of more neutrons.
Elements with same mass numbers but different atomic numbers are called Isobars. Eg.- Potassium isotope (K-40) and Calcium (A = 40). These are always different elements, and almost always involve an isotope.
Valency is the tendency of an element to give / take electrons to complete an octet, during a chemical reaction. Calcium can give away two of it's valence electrons, hence it has a valency +2, while chlorine can take one electron, hence it has a valency -1.