Acid strength depends on atom’s capacity to accommodate the electron pair left behind by the departing hydrogen ion. There are basically two factors which affect the atom’s ability of accommodation of electron pair that is electronegativity and size. If we move within a row (from left to right) of periodic table acidity increases due to increase in electronegativity and within a column (from top to bottom) of periodic table acidity increases due to increase in the size of the atom which enhances the capacity of accommodating the electron pair left behind after releasing of hydrogen.
Example (increasing acidity order):
H-CH3 ˂ H-NH2 ˂ H-OH ˂ H-F
H-F ˂ H-Cl ˂ H-Br ˂ H-I