Gram staining is a procedure founded by Christian Jacobs Hans Gram in 1883 in Germany. The Gram stain is a technique devised to categorise most bacteria into two sub-categories; gram positive and gram negative, based on the properties of the cell wall.
The cell wall’s characteristics determine Gram staining. Gram negative bacteria contain an asymmetric bilayer, where the outer layer consists of lipopolysaccharide which acts as a permeability barrier and prevents the entrance of the Gram stain in the periplasm. The peptidoglycan layer within the periplasm is dense whereas the cell wall of gram positive bacteria has a thin layer of peptidoglycan. 
Method of Gram staining
In order to perform the Gram stain, a primary and secondary stain is required, in addition to a mordant, decolouriser and water. To initiate the process, a smear is heat-fixed by being passed through a Bunsen burner several times. Next, the primary stain, which is usually crystal violet, is applied to the slide for approximately a minute in order to allow the dye to bind to the cell wall. The unbound stain is then removed by rinsing the slide with water. Then, the mordant, which is usually Gram’s iodine, is added on to the slide which allows the crystal violet to be fixed to the cell wall by the formation of violet-iodine crystal complexes. The sample is left for one minute and then is washed again with water. The slide is then decolourised with an alcohol substance, usually at a thirty degree angle for between three to five seconds and is then washed away.
The decolourising process is important as the primary stain is removed from the Gram negative bacteria due to the cell wall’s outer lipid layer dissolving. This causes the violet-iodine to leak and therefore the sample will become decolourised. However, if the organism is gram-positive, the slide will stain a dark purple as the cell wall will allow the stain to be retained. However, if the decolouriser is left on for too long, the primary stain may be removed from a gram-positive organism and therefore the organism may be wrongly identified as being gram negative.
The final procedure of the gram stain is the use of the secondary stain, otherwise known as the counter stain, usually safranin. The decolouriser is rinsed off with water and then is drowned in safranin which does not affect the gram-positive organism but causes the gram-negative cells to gain a red stain.    
In conclusion, it is apparent that the most important aspect of the Gram stain is the retention of the primary stain as this can initially determine whether the bacteria is gram-positive or gram-negative during the decolourisation process. However, an important factor to be considered when Gram staining is that not all bacteria can or are necessary to be classified as Gram positive or Gram negative.