Strictly speaking, Turkey does not claim Cyprus. The northern part of Cyprus, unlike the affair between Crimea and Russia for example, has never been formally annexed by Turkey (the northern part is governed by a scarcely recognized, only by Turkey and Pakistan.
The state of Cyprus was established in 1960, by Turks and Greeks of the island. The declaration of the republic followed a series of negotiations between Turkey, Greece, and the UK, of which Cyprus had been a colony. The negotiations in London and Zurich set several strict rules for the island: what ethnicity would have what role and how the federation would work. Long story short, it did not work. It seems that neither side was entirely convinced with the arrangement. Turks started contemplating how they could get a better deal, but crucially, the Greek Cypriots, which formed the majority, took up arms once again, having previously led an anti-colonial campaign against British forces in the island. Several acts of violence by these groups against Turkish Cypriots, as well as the overthrowing of the president Makarios III on 15 July 1974, was the last drop for Turkey. Makarios was replaced by a man called Nikos Sampson, who was notorious in Turkey for his support for Enosis, which was basically, a pan-Hellenic project aiming for the annexation of Cyprus by Greece. In July-August 1974, the Turkish military intervened in Cyprus through an amphibious operation of colossal size and defeated the Greek Cypriot forces. The Greek Cypriot resistance (including the nationalist group EOKA-B) supported by the Greek military junta at the time, failed to stop the Turkish advance in late July, but also rejected any compromises with the Turkish side. The second wave of Turkish intervention followed in August 1974, likewise successful. Turkey established de facto control on the Northern side, moved, often by force, Greeks to the southern side, and seeing that no international agreement was on the horizon, allowed and/or encouraged Turkish Cypriots to declare their own republic in 1983. That is, in short, why Turkey seems to control part of Cyprus today. In the meantime, almost instantly following the failure to stop the Turkish landing on the island, the Greek junta fell and made way for democracy.
The important thing, and incidentally also the thing leading to the current legal stalemate in modern Cyprus, is this: remember the treaties in 1959 which led to the formation of the new state of Cyprus? Well, the treaties declared Greece, the UK, and Turkey “the guarantors of the state of Cyprus.” Turkey thought this gave it enough justification to intervene. The Turkish government at the time applied to the UK to intervene first, but the British declined. The Americans tried to deter Turkey too, fearing the cracks a confrontation between Greece and Turkey would open in the NATO. Turkey still went ahead with the intervention and faced American embargoes as a result (along with the Greek Cypriot side.) But in the long term, Turkey established de facto control over the northern part of the island, successfully put an end to the plans of Enosis to the relief of many Turkish Cypriots, and also remedied its relations with the US in the long term.
Finally, from a strategical point of view, when you leave all the legal and humanitarian motives for Turkey aside, Cyprus is basically a gigantic aircraft carrier in the Eastern Mediterranean. No sane Turkish politician would willingly cede Cyprus to Greece considering this, because, in the not-so-unlikely event of a war, Greece could threaten Turkey from the West and the South simultaneously. Plus, hold Cyprus, and have a say in anything that goes on in the Eastern Mediterranean. Hence the developments in the Eastern Mediterranean nowadays regarding natural gas reserves. As badly isolated as the current Turkish government is, so long as there is a considerable Turkish force on the island, Turkey has a say (obviously not a superpower-like control) on whatever goes around in the area.