An ethnonym is, in short, a name applied to a group of people. It is etymologically derived from the Greek éthnos (which means 'nation') and ónoma (which means 'name'). Ethnonyms can be divided into two categories: exonyms, which are given by outsiders, and autonyms, which are what a particular ethnic group calls themselves.
An example of these two categories at work is the various names for the Basque people, who call themselves Euskaldunak, and whose exonyms typically are derived from the Latin vasco (Sp. vasco, Fr. basque, etc.).
Even more complex situations arise with the Germans, who have a whole slew of exonyms: It. tedesco, Fr. allemagne, Fin. saksa, Pol. nemec, all of which (except the first and last examples) came from different names for the Germanic tribes encountered by each people. The Italian example is the only one etymologically related to the autonym for the German people, deutsch (both words were derived from the Germanic root *theodiskaz, meaning 'people').