"Mucopurulent mattering in the punctum"* is the official name for the sometimes-crusty-sometimes-gooey-sometimes-both substance that one finds accumulated in the fleshy bump (the caruncula lacrymalis) at the corner of one's eye (the commissure) upon waking.

While awake, one's eyelids are constantly wiping the eye clean of the sweat, tears, oils, and foreign substances (like dust, pollen, &c.) that would otherwise impede its functioning. Obviously, the eyelids are not doing this when you are asleep. These materials gather at the caruncula and are kept there by the familiar whitish secretion (dried tear mucous), which then hardens, allowing the materials to be removed easily upon waking.

*(a/k/a "eye snot", "eye crud", "eye cruft", "sleepies", "sleep", "sand", "rheum") Here are the Harvard University Dialect Survey results for this word:

http://hcs.harvard.edu/~golder/dialect/staticmaps/q_82.html

Sources:
My medico friends, Nancy and Dr. B., who enabled me to find the technical term, without which I'd have been writing purely based on what I could find for snot, crud, and suchlike terms.
http://ask.metafilter.com/mefi/7384
http://www.wa-eyemd.org/Epiphora%20differential.htm
http://yucky.kids.discovery.com/noflash/body/index.html

This write-up is in the public domain.