Plant leaves are organs which are the major site of photosynthesis. The diagram below shows the cross section of a leaf.
The waxy cuticle on both the top and bottom surface of the leaf reduces uncontrolled water loss. Palisade mesophyll cells are found towards the top of leaves. They are packed with chloroplasts to maximise photosynthesis. Below this layer, are spongy mesophyll cells. These have air spaces between them to allow gases to diffuse more easily.
Stomata are tiny pores found mainly in the bottom of leaves. These are surrounded by guard cells which swell to close the stomata or reduce in size to open it. By opening and closing, stomata control the exchange of gases between a leaf and the air surrounding it.
Oxygen and carbon dioxide move by diffusion from high to lower concentration through stomata.
It is important to remember that plant cells are respiring all of the time. Plant cells with chloroplasts also photosynthesise in the light.
Aerobic respiration requires oxygen and photosynthesis requires carbon dioxide.
The diffusion of gases into and out of leaves depends upon the time of day. If there is enough light during the day, then the rate of photosynthesis is higher than the rate of respiration, so there is an overall release of oxygen and uptake of carbon dioxide. This means oxygen diffuses from the leaves and carbon dioxide diffuses into them, as the guard cells will open the stomata.
In the dark only respiration occurs, so there is an overall intake of oxygen and release of carbon dioxide. This means oxygen tends to diffuse into the leaves and carbon dioxide diffuses out from them. However, in these conditions the guard cells will reduce the size of stomata, to reduce water loss, and so movement of gases into and out of the leaves will be reduced.