When temperature increases, the solubility of some substances increases but that of some other substances decreases.
Firstly, consider the solubility of solids.
solid + aq ⇌ solution …… ΔH
According to Le Chatelier's principle, increase in temperature favors endothermic reaction.
If the dissolving process is exothermic (ΔH < 0, e.g. Na₂SO₄ ), increase in temperature would lead to the shift of equilibrium position to the left and thus the solubility decreases.
If the dissolving process is endothermic (ΔH > 0, e.g. KNO₃), increase in temperature would lead to the shift of equilibrium position to the right and thus the solubility increases.
The diagram below shows the relationship between the solubility of some solid salts and temperature.
For all gases, the higher the temperature, the lower the solubility is.