See, in the bottle, there's little air. What makes the glue move is the water in the glue. In the bottle, there's no air, so the water doesn't evaporate. When it leaves the bottle, or the bottle is left open, the water evaporates or dries and sticks things together. We say it dries because it loses the moisture by evaporation.