Great Britain is the largest island in the British Isles. There are quite a few[1] smaller ones. Great Britain contains parts of England, Scotland, and Wales. The isle of Ireland is the second largest (and second most populous) and contains parts of the Republic of Ireland and Northern Ireland. The United Kingdom of Great Britain and Northern Ireland (the UK) contains the countries England, Scotland, Wales, and Northern Ireland. The British Isles also contain the Isle of Man, Gurnsey, and Jersey which are not part of any of the countries in the UK, but are instead Crown Dependencies[2]. Those are neither sovereign states nor members of the UK.
Indeed, Great Britain is the island containing England, Wales, and Scotland, and the UK is Great Britain plus Northern Ireland.
But GB is the ISO 3166 code for the UK, including Northern Ireland. The reason is that the ISO committee wanted to avoid generic words like "united" and "kingdom" so they went for the more "unique" GB, in spite of being somewhat politically sensitive, confusing, and inconsistent with some other standards and every-day usage.