Whom is the objective form of who. It is used when you are referencing the object of a verb rather than the subject of it, such as "Whom did you talk to?" In this sentence "You" is the subject, the verb being talk, and as it is the object of the verb that is in question, whom is used rather than who.
One important note is that, atleast in the United States, this word is almost completely obsolete. Most native English speakers don't know the difference, and they will rarely if ever use the word in favor of simply using who for both the object and subject. Personally, I only use it in academic writing, never in speech.