Answer:
The sense of identity was born during the Greco-Persian Wars in the IV century BC.
Explanation:
Identity in the period was more of a cultural distinction rather tan a territorial one. Greece at the time was a patchwork of city-states (the <em>poleis)</em> each with its uniqueness. However, the culture was the link binding the Greeks. Thus, the sense of Hellenism was created by the common cultural links (religion, language) although not in a binding way, for each polis managed its political differences as it fit convenient (a reason why Sparta and Athens played diplomatically with the Great King in Persia during the Pelopponisian War).
Identity rose because it was a way to clearly difference between the Greeks and the "barbarians". This could be seen particularly in the works of Aristotle, and during the conquest of Persia by Alexander the Great.
https://medium.com/@vathsan32/the-greco-persian-wars-and-the-myth-of-hellenic-unity-fb3608a0f9c1
https://www.livius.org/articles/misc/persian-influence-on-greek-culture/