The stomata closes down at night when there is no sun and there's no photosynthesis. It also closes down when the air is dry and when it's hot so as to prevent excessive loss of water.
Xerophytes are plants that have adapted to arid climates. They have evolutionary developed adaptations to reduce the rate of transpiration so as to conserve water.
Among the adaptations include; thick cuticle, small, thick leaves, reducing the surface area relative to the volume of the leaf, etc.
Additionally, they use CAM pathway as an alternative photosynthetic pathway to minimize water loss.