According to Thucydides, Hellenes were 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 (based in Dodoni), the Dorian tendency to form amfictionies and the increasing popularity of the Delphic religion caused the name to refer to all people today known as Greeks (that name having come from the Graecoi, another tribe of Epirus). Before that the Hellenes (or Greeks) were distinguished in tribes (phylae) such as Achaians, Dorians, Ionians, etc.
In 212 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.