Word or phrase that can mean something and its opposite

Solution 1:

Wikipedia has a pretty long list of names for words like this:

An auto-antonym (sometimes spelled autantonym), or contronym (also spelled contranym), is a word with a homograph (another word of the same spelling) which is also an antonym (a word with the opposite meaning). An auto-antonym is alternatively called an antagonym, Janus word (after the Roman god), enantiodrome, self-antonym, antilogy, or addad (Arabic, singular didd). It is a word with multiple meanings, one of which is defined as the reverse of one of its other meanings. This phenomenon is called enantiosemy, enantionymy, or antilogy.

EDIT: If anyone's interested, here's a brief video that explains the etymologies of some common auto-antonyms (the video uses the term "contronyms").

Solution 2:

Are you referring perhaps to auto-antonyms? (Also known by other names, such as contranyms.)