Gray matter is the collective term for the cell bodies of neurons; the term white matter refers to the axons. The cell bodies got this name because they look gray under a certain kind of stain. The cerebral cortex is comprised (almost but not quite entirely of) gray matter, as are the subcortical structures.

Some people use "gray matter" as a colloquial term for the brain in general. "Use your gray matter!" means "Think, damnit!"