This is a question from Peggy in Washington, DC. She was often asked this by friends after returning from a stint studying in Glasgow!
It's a very good question that even a few Brits might scratch their heads over.
The confusion arises from our long history and - very often - from the context the names are used in. But the official side of things is easy to keep track of:
Slowly. In prehistoric times, these islands on the edge of the known world were called Britain. The Phoenicians came here to trade for tin and copper and wool.
Then the Romans appeared and decided to add the country to their empire. They named their new province Britannia.
After the Romans retreated, Germanic peoples - Saxons, Danes and Angles - arrived from the north and east. They eventually settled and the Angles gave their name to these islands: Land of the Angles or Angelland ... or England as we know it today.
Eventually, England became a kingdom, bordered by the kingdoms of Wales in the west and Scotland in the north.
Not until the reign of Edward I (1272 - 1307) did Wales become a part of the English king's realm. Edward also fought the Scots (remember Braveheart?), but Scotland kept her independence.
Great Britain was not born until 1707, when the Acts of Union merged the Kingdom of England and the Kingdom of Scotland into the Kingdom of Great Britain.
Great Britain and United Kingdom (or UK for short) are used across all media when describing the country in general.
England is used to distinguish that part of the UK from either Scotland or Wales or Northern Ireland.
Most people here call themselves Brits - unless a matter of national pride like football, rugby or tennis is at stake - when they become fiercely Welsh, English, Scottish or Irish respectively.
If you've an ear for such things, a person's accent will tell you which part of Britain they're from.