Guard cells control the size of the opening of stomata. By this function, guard cells control the exchange of gases (mainly carbon dioxide and oxygen) between the leaves and the atmosphere. Guard cells are present in pairs and are part of the epidermis of the plants. When a stoma has to be opened, guard cells sense the signal and start producing cytoplasmic solutions. This causes a reduction in cell water potential and results in an influx of water. This causes inflation of guard cells and the stoma opens. Stoma can be closed by reversing the influx of water, which causes the guard cells to become flaccid. By controlling the level of carbon dioxide and oxygen in the plant, the stomata regulate photosynthesis and by controlling the transpiration levels, stomata avoids too much water loss from the plant.
Hope this helps.