Rick Watling, a meteorologist with the National Oceanic and Atmospheric Administration, offers this explanation.

Atmospheric gases such as nitrogen and oxygen can dissolve in water. The amount of gas dissolved depends on the temperature of the water and the atmospheric pressure at the air/water interface. Colder water and higher pressure allow more gas to dissolve; conversely, warmer water and lower pressure allow less gas to dissolve.

When you draw a glass of cold water from your faucet and allow it to warm to room temperature, nitrogen and oxygen slowly come out of solution, with tiny bubbles forming and coalescing at sites of microscopic imperfections on the glass. If the atmospheric pressure happens to be falling as the water warms, the equilibrium between gas molecules leaving and joining the air/water interface becomes unbalanced and tips in favor of them leaving the water, which causes even more gas to come out of solution. Hence bubbles along the insides of your water glass.