According to Thucydides, Hellenes were called the people of Hellas. Greek mythology states that were named after Hellene. A more scientific approach places the origin of the name in Epirus, the land of the Dorians, where people were called Selle or Helle. The spread of the worship of Zeus in the rest of Greece (the basis of which was in Dodoni), the Dorian tendency to form amfictionies and the increasing popularity of the Delphic religion lead to the use of the name in a way that denoted the people that today is known as Greeks. Before that the Hellenes (or Greeks) were distinguished in phylae such as Achaians, Dorians, Ionians, etc.
In 212 AD the Roman emperor Caracalla gave people from Roman provinces equal rights to those of the citizens of Rome and the right to call themselves "Romans". The name Hellenes, which by then had become a synonym of attachment to old religions, was replaced by the name Roman.
After the independence of modern Greece from the Ottoman Empire the new founded country was named officially "Hellenic Republic" (or 'Hellas") and the people "Hellenes". The name by which the country and the people are broadly known, though, is Greece and Greeks respectively.