A homophone is a word that sounds the same as another word but has a different meaning.
A homograph is a word that is spelled the same as another word but has a different meaning.
The study of homonymy focuses on words that are spelled and pronounced the same but have different meanings.