The opening and closing of stomata are regulated by the water movement in and out of the guard cells.
When water moves into the guard cells, they swell up (turgid) and the stomatal pore opens.
When the water moves out of the guard cells, they shrink (flaccid) and the stomatal pore closes.