As others already say in comments, the complete answer to this question is still unknown. However, the basic mechanism has been understood and has been summarized in the following diagram (from Wikipedia):

As you see, the mechanism is regulated by temperature instead of presence of light, keeping in mind that high temperatures are generally observed during the day and low tempertures at night. Temperature regulates, at the expression level, the activity of an enzyme PEP-C kinase. This enzyme phosphorylates PEP carboxylase (or PEPCase in short), which increases its activity. So lets see what happens when temperture is high:
During day:
high temperature inhibits expression of the enzyme PEP-C kinase, which decreases the activity of PEPCase.
activity of PEPCase is further reduced by an enzyme PEP-C phosphatase (this enzyme is active all the time, but its effect is reversed by PEP-C kinase).
due to respiration and photosynthesis, the amount of cytoplasmic malate is reduced (malate is converted to pyruvate to yield NADPH for photosynthesis, and pyruvate is used up in TCA cycle, whose by-product, $\ce{CO_2}$, is used up in calvin cycle).
due to this, malate is released from vacuole into the cytoplasm. This malate is not only used up in photosynthesis and respiration, but also further inhibits activity of PEPCase and expression of PEP-C kinase.
because PEPCase is inhibited, it results in depletion of malate in cytoplasm as well as vacuole.
During night:
at night, stomata open leading to increase in amount of $\ce{CO_2}$. Also, low temperature is unable to inhibit expression of PEP-C kinase.
when activity of PEPCase increases, PEP is converted to malate, which is then transported into vacuole. Also, increased concentration of $\ce{CO_2}$ increases photosynthesis.
Where is light required? As already said, the exact mechanism is still unknown. The mostly accepted mechanism is potassium ion pump hypothesis, but problems arise when we think about the initiation of this process in CAM plants. There are many hypotheses regarding this, and I will follow the one presented by Lee, 2010. Lets begin with the diagram (don't pay attention to the spellings):

initial stomatal opening is mediated by phytochrome in guard cells. The $\ce{H^+}$ pump in guard cells is also activated by darkness.
the maleic acid synthesized in other cells is also transported to the vacuoles in guard cells. There, the intracellular $\ce{H^+}$ (from maleic acid) is exchanged for intercellular $\ce{K^+}$.
increased concentration of $\ce{CO_2}$ also regenerates glyceraldehyde-3-phosphate and ribulose-1,5-bisphosphate, which lead to formation of sucrose via calvin cycle.
this sucrose is again transported to vacuole of guard cells, adding up to osmotic pressure. However, the major effect comes from maleic acid.
increased $\ce{CO_2}$ concentration and increased activity of PEPCase (as already explained) form malate and lead to further increase in the osmotic concentration. All this causes stomata to open.
during the day, malate is decarboxylated to pyruvate (as already explained), leading to decrease in osmotic pressure and thus, closing of stomata.
I hope this makes the concept more clear, but bear in mind that the above mechanism could later prove to be wrong as further studies on CAM plants help to find out the actual mechanism.