The solubility of a solute is the maximum amount that will dissolve in a given quantity of solvent at a specific temperature. This means that, by definition, temperature affects the solubility of most substances.
For most solid solutes, their solubility in water increases as the solution temperature increases, although there are exceptions, such as cesium sulfate.
As the temperature changes, the solubility of different substances increases at different rates. For instance, the solubility of potassium nitrate rises sharply with temperature, while that of potassium chloride changes very little.
When a solution containing a mixture of potassium nitrate and potassium chloride is heated and then cooled down slowly to ten degrees, the crystalline precipitate will contain more of the potassium nitrate since it is less soluble at low temperatures.
This separation technique is known as fractional crystallization.
In contrast to solid solutes, the solubility of gases in water decreases with increasing temperature.
If a beaker of cold soda is warmed to room temperature, the soda flattens quickly. This is because the solubility of carbon dioxide decreases with increasing temperature.
The solubility of gases also depends on pressure. The higher the pressure of a gas above a liquid, the more soluble the gas is in the liquid.
This relationship between pressure and the solubility of a gas is quantified by Henry’s Law, which states that the solubility of a gas equals the Henry's Law Constant multiplied by the pressure.
While making soda, carbon dioxide is dissolved in a sugar solution under high pressure. The pressure above allows the solution to become saturated with carbon dioxide.
Thus, when a soda can is opened, we can hear the familiar pop as the pressure is released and see many bubbles form as the carbon dioxide gas escapes from the solution.