Stomata open when there is sunlight. Therefore, stomata are usually open during the day and closed at night. However, according to Darwinian principles, plants that reside in arid environments have developed characteristics that affect the opening and closing of stomata to help withstand water shortage.
Stomata are opened to allow carbon dioxide to enter the plant and oxygen to leave the plant. Carbon dioxide is required, along with water and sunlight, to form sugars in a process known as photosynthesis. Given that stomata receive no light energy at night, there is no purpose for the plant to keep them open.