As atomic number increases, atomic size, number of electrons and shells also increase. So due to higher atomic size and maximum number of electrons, there should be maximum repulsion forces between atoms in a state of matter as the atomic number increases. Then how is it that at STP conditions all states of matter have equal number of atoms as stated by Avogadro?
It is not true, nor did Avogadro claim it was true, that all states of matter have the same number of atoms in STP conditions.
You are probably confusing this with the related result that most gasses have approximately the same number of molecules per unit volume in STP conditions. This holds because, in the gas phase, attractions between molecules are typically weak, and the distances between molecules are typically much larger than the molecules themselves.