The human body being a relatively good conductor has a capacity to absorb retain and release a charge. The amount of charge it will absorb depends on the individuals size, the magnitude of the applied voltage, their proximity to other conductive bodies (which would increase their capacitance) and their isolation from other charge carriers that would allow the charge to pass through or
bleed out of their body.
An alternating voltage (such as mains voltage) having a constantly varying potential will force a charge into and out of the human body in proportion to the applied voltages magnitude and frequency of alternation. The alternating difference in voltage potential between the conductor and the attached body is what produces the current flow.
Depending again on the magnitude of the voltage at the time one releases the voltage conductor one could potentially carry the accumulated charge over to another conductive body (such as a doorknob) and release part of the charge accumulated until (almost instantly) the difference in charge between them is equalized.
You may want to Google
human capacitance for more information relating to this subject