According to the Oxford English Dictionary, the word shotglass first appeared in print in the 1940s. There are many apocryphal stories about its origin, but none of them stand up to scrutiny. They all place the origin at least decades before the word or phrase shows up in print; or they describe an item that had nothing to do with drinking liquor.
Many references from the 1800s describe giving workers who were digging canals a jigger of whiskey or rum. Most shotglasses are found in America, and shotglasses from before the 1940s are very rare. The word shotglass (or phrase shot glass) does not show up in print until the 1940s in The New York Times, in a story about an effort to regulate the size of a shot of liquor in New York; and did not come into common usage until much later.
If the origin of the shotglass was sparked by special circumstances in America, in the years before the Second World War, the likely candidates are The Great Depression, and Prohibition. Although most people associate the beginning of prohibition with the passage of the Volstead act, alcohol was locally prohibited in many locations years before the passage of the act (see local option). Since the Great Depression was a worldwide phenomenon, and shotglasses evolved only in America, the depression was probably not a major influence on the birth of the shotglass.
The obvious connection between Prohibition and the shotglass is they are both related to alcohol. Before Prohibition, thin-sided whiskey glasses were common . After Prohibition, the shotglass with thick base and sides had replaced them.
 The Old West
The most popular origin story is that the shot glass originated in the Western saloons of the Old West. The story explains that the cowboys of the old west would trade a cartridge (bullet plus powder and primer encased in brass) for a small amount of alcohol. One problem with this story is that, even if true, your average old west saloon would not be able to “commission” the creation of a new style of glass to fill this purpose – even today many bars do not stock shotglasses; they serve shots in ordinary whiskey glasses. Another problem with this origin story is the economics of such a trade are such that it would never happen. Alcohol sold for much more than a single cartridge.
 Bird or Buck Shot
Another origin story is that a "shot glass" was a glass used at the dinner table to place any "shot" left in your meat that you would find during a meal. However, people were shooting their food with shotguns for hundreds of years before the shotglass was born. See (Shotgun History). There may have been a "shot glass" for this purpose, but the shot glass did not come from it.
 Quill Pen Holder
Another story ties the origin of the "shot glass" to the use of quill pens. According to this story the term "shot glass" was coined over 100 years ago, describing a small, thick-walled glass placed on a writing desk, and filled with small lead BBs, or shot. A feather writing quill would be placed in the glass when not in use, and the lead shot would hold the quill upright. An upright quill was more easily removed from the glass.
Even if there was a "shot glass" used for quill pens, it was probably a different size and shape -- the thin base and wide top of a standard shotglass are quite unstable for inserting and removing a quill (or even just for having on a desk). A "shot glass" for holding a quill is more likely to have a small top and a large base, the opposite of what we know of as a shotglass. See http://www.libertybellmuseum.com/MuseumShop/quills.htm for sample quill holders
 Firing glass
An additional origin story ties the birth of the shot glass to the sound of a gunshot. Certain fraternal organizations have a custom of drinking toasts from specially shaped glasses known as cannons. Another name for these glasses are "firing glasses", which comes from the French calling the toast "feu" or "fire". If the glass is slammed on the table, it makes a sound like a gunshot – a firing glass then becomes a "shot glass". Not only is the firing glass much older than the shot glass, it also has a very specific shape (relatively thin sides, very thick protruding base) which is quite different from the shot glass.
 From the Word Shot Meaning "A Small Amount"
The word shot also means "dose" or "small amount", such as an immunization 'shot'. This use pre-dates the use of the word "shot glass". Therefore, the small glasses are called shot glasses because they hold small amounts.
 Friedrich Otto Schott, Ernst Abbe and Carl Zeiss
The word shot was originally spelled Schott, and named after Friedrich Otto Schott a German chemist and Glass Technologist who helped Ernst Abbe (a physicist) and Carl Zeiss (an instrument maker) develop some of the first Optical lenses in Germany, many years before any of the above theories. Schott, Abbe and Zeiss, founded a glassworks factory (Jenaer Glaswerk Schott & Genossen) in Jena, Germany in 1884. 
This Jena glass has been theorized as the origin of the first "Schott Glass" and the source of the name, which was later shortened in the USA to "Shot Glass" and the original origin of the word forgotten.