Understand how glass responds to heat.
Most commonly, glasses get stuck together when they are stacked immediately after they are washed. Glass expands when heated, and contracts as it cools, and this is sufficient to stick glasses together in some cases.
Never fear: you can use this to separate the glasses. You will need to cool the inner glass and heat the outer glass in order to free them from each other.
Heat the outer glass. This method carries some risk, so you should use it with care. Since the outer glass is the one that has shrunk around the inner glass, this one needs to expand to allow the inner glass to slip away. Gently heat the outer glass by running it under the hot tap for a minute or so. With any luck, the glasses should come unstuck. If not, you may wish to consider cooling the inner glass, by filling it from the cold tap.
Avoid using ice or boiling water. The sudden change in temperature could cause one or both glasses to shatter violently, which could be very dangerous. The glass is already under compression, making the situation especially risky.
Cool the inner glass. If you cannot free the glasses by simply heating the outer glass, try to cool the inner glass. The outer glass will expand, and the inner glass will contract.
Try using a bowl of hot water.
First, fill the top glass with cold water. Then, fill a shallow bowl with hot water and bathe the base of the bottom glass into the heat. Let the glasses sit like this for a few minutes, then try to pull them apart.
Gently pull the glasses apart. The temperature difference should separate the glasses. Hold the glasses firmly, with one hand on the bottom of the bottom of the outer glass and one hand encircling the rim of the inner glass. Twist and tilt the glasses, and gently tug them apart.