There are many ways to estimate the instant of glottal closure (GCI). Here (PDF link) is a recent journal article that reviews many of them. The freely-available VOICEBOX toolbox for Matlab includes a couple GCI estimation techniques.
For most approaches, the fundamental idea is the same: the speech signal is can be viewed as an excitation signal resonating an all-pole filter, and the location of the excitation instants is the instant of glottal closure.
A simple GCI estimation algorithm might work like this. The all-pole filter (encapsulating the contributions of the vocal tract and glottal source) can be estimated using linear prediction. Inverse filtering the speech signal with this (time-varying) filter will give the linear predictive residual signal, which is an estimate of the excitation signal. For normal voices, this signal will look like a noise impulse train. Peak-picking this signal will give good results for these voices during sustained vowels. Voice offsets and onsets will be more troublesome, as well as voices that are very breathy or irregular.
(A quick note about your figure: the signal marked as the residual seems to include glottal source signal, and so it not a linear prediction residual in the same sense as what I refer to in the above.)