Nowadays many sovereign countries have long, official names that reflect the stateform and nation such as "Federal Republic of Germany", "Russian Federaion", "Kingdom of the Netherlands" and "United States of America". But in daily speach, they are mostly referred to as simply "Germany", "Russia", "Holland/the Netherlands" and "USA/America".
It is of course not a good idea to talk about different countries and then use the full official name each time, but using the official state name would be essential to refer to certain countries in official documents where distinction and punctuality is important.
Was this always done? Were geopolitical entities referred to their official name in treaties in antiquity or the middle ages? Did they even had actual official names like there are now? And if this all is not the case, from what moment and why did people began to use long official state names?
This is a broad question. There's no specification of time or region. Which is perhaps more relevant to what you want to know, but it does make it harder to give a clear answer. But in that case the answer can be made up of multiple answer covering various examples and trains of thought, so here's mine.
In the developed states of Medieval and Early Modern Afro-Eurasia (a circuit which excludes the undeveloped states of southern Africa) there were two main forms. The default state was a kingdom, it was generally the most common and expected state and can quite easily arrive from any tribal chiefdoms and city-states when they grew large enough and national leaders emerged.
Nationalism and patriotism as we understand them are more of a 19th century idea, so while national identity and pride definitely exist in the kingdom, it is defined first by ruler claims, while a sense of identity comes later and only begins to develop independence from ruling rights over time. In the introductory speech of Henry V, the Chorus narrator says: "Suppose within the girdle of these walls, Are now confined two mighty monarchies" (text from here: http://shakespeare.mit.edu/henryv/full.html) not referring to the monarchs themselves or even the crown governments but the nation state as a whole actor, even referring to "high upreared and abutting fronts, The perilous narrow ocean parts asunder" bringing in the lands. But they are defined as monarchies. Even in a more recent period, writing a piece with a distinctly jingoistic air, the national identity is not defined or treated in the same way as now. I differ from some on the extent of this difference, a fraught issue; "It is doubtless impossible to name any event of which one may confidently assert that it reveals a modern nation in the very act of emerging into conscious existence, a nation, that is to say, as distinct from an earlier clan, tribe, province, or kingdom" (Louise R. Loomis, "Nationality at the Council of Constance: An Anglo-French Dispute", 1939). But there is definitely an agreed difference. The name of a kingdom was simply a list of territories, e.g. the Kingdom of England, France and Ireland was the official title for the united holdings of the English monarch during the 16th century. They usually had recognisable national names but were grouped by inheritance and their borders could change based on that inheritance. At one point during the geopolitical phase known by modern scholars as the Angevin Empire, specifically under the reign of Henry II in his glory days, England owned more of France than the French (Sean McGlynn, "Philip Augustus: King of France, 1180-1223, by Jim Braybury", 2000) Notice that Wales is not in the title of the British crown, despite being much more a real possession than France during the 16th century, because Wales was entirely conquered under the Kingdom of England and was never recognised as an independent crown.
The second model is the republican one. In the cultural and trade circuit between north Africa, Europe and Asia the main reference point, particularly with amour from the European side, was the Roman Republic. It's important to capture the impact Rome had on the world, particularly in this circuit which it had territories on all sides of. For the Europeans in particular, Rome was always the ideal reference point in either imperial or republican aspect. I know less about the eastern side of things but the only eastern power I know of which drew upon this reference in the same way was the Ottomans who portrayed themselves as the successors of Byzantium after capturing Constantinople. Republican models which did exist drew upon this reference point. Their names were largely reflective of this by inheriting the term republic for European republics; the Most Serene Republic of Venice, the Republic of Geneva, these were up-jumped city-states. The Dutch republic formed in the 16th century was referred to as the United Provinces or the Seven United Provinces because it was formed from the seven northern Protestant provinces. The republics were fairly regional as without the monarchal definition they relied on the very strong local identities of the time, which did not cover so large an area. The localism is why one of the larger ones, the United Provinces, was defined like the United States was as a union of smaller regional bodies, whereas when Venice expanded its territories they were defined as territories of the city which was the central, original and constant basis. The term "Venetian Empire' is sometimes used in Mediterranean historiography as a third power to Spain and the Ottomans but they were referred to and understood at the time as simply "The Most Serene Republic of Venice" with it's territories implicit.
There are also slightly divergent examples. The Ottomans were essentially a monarchy but were not referred to as that and had no king. The Empire was more clearly defined as an empire on the precedent of Byzantium and Islamic caliphates. The Ottomans defined this territory not only by shared allegiance to the Sultan, but also by the cause of (Sunni) Islam that they represented, much as other caliphates (Michael C. Howard, "Transnationalism in Ancient and Medieval Societies: The Role of Cross-Border Trade and Travel", 2012, p. 70). The Holy Roman Empire was more like a federation than an empire, but also defined itself with reference to the Roman Empire as well as to the personal title of its rulers. It's interesting that the idea of a German region existed and grew during the empire's existence, influenced I think partially by the Roman lumping together of Germanic tribes; it was Caesar after all who coined Germania. Same is true of the recognition of the Italian region and language group despite it being very localised during the Medieval and Early Modern periods. Which again emphasises that nation-states were formed more by some titular claim laid out in their official styles than by pure de jure sovereignty of a people which is more our concept now (at least in theory). This is one reason why titles and how different territories were accounted for in them varied, it was specific to the reason why these places which could and had been independent were now bound. What their former status and interactions with the conquering power were like changed how the power defined them.
So, in conclusion state names were actually very important because they defined what the territories were as a collective and the way they recognised them meant something about their relationship. It was a long running and significant issue.