A shirt is a sort of top, i.e. a piece of clothing for the trunk of the body.
In the UK, it refers almost exclusively to what Americans call a dress shirt, i.e. a garment with a collar and a full vertical opening with buttons. In the US is tends to have a vaguer meaning, being applied to many types of (mainly men's) tops, leaving the word "top" generally for ladieswear.
Some common types or synonyms of shirts and tops:
T-shirt
polo shirt ? a shirt with collar but only a partial vertical opening with buttons
shirt or dress shirt ? a shirt with collar and full vertical opening with buttons
tank top ? a sleeveless T-shirt
wife beater ? a tank top worn as an outer layer
blouse ? ladies shirt ? the term is also used for some men's military uniform shirts.
nightshirt ? for sleeping
sweater, sweatshirt ? with or without hood
rugby shirt ? typically a rugged long-sleeved polo shirt
Hawaiian shirt ? a colourful short-sleeve dress shirt
guayabera ? an embroidered dress shirt with four pockets
golf shirt ? a polo shirt
baseball shirt ? usually distinguished by a three quarters sleeve
first shirt ? the "shirt" is a nick-name for a First Sergeant