Here is a more detailed explanation:
The Romans used the term "Scoti" to refer to the Gaels of Ireland, distinguishing them from the Picts, who inhabited what is now Scotland. The Gaels were a Celtic people who had migrated to Ireland from continental Europe in the Iron Age.
In the 5th century AD, some of the Gaels from Ireland migrated to what is now Scotland, and they came to be known as the Scots. They settled in the western and northern parts of Scotland, and they gradually assimilated the Picts.
The name "Scotland" was first used to refer to the territory of the Scots in the 11th century AD. The earliest recorded use of the name is in the Anglo-Saxon Chronicle, which refers to "Scotland" in 1070 AD.
The name "Scotland" is derived from the Old English word "Scot-land", which means "land of the Scots". The Scots themselves called their country "Alba" or "Albainn", which means "white" or "highland".
The name "Scotland" has been used to refer to the country ever since the 11th century AD. It is the official name of the country, and it is used in all official documents and communications.