What are the differences between how glucagon and cortisol work to increase blood sugar?
Glucagon and cortisol are VERY different types of hormones, though each of them can affect glucose metabolism and effectively can increase glucose concentrations in the blood (albeit through different mechanisms).



Glucagon, pictured above, is a 31 amino acid peptide hormone (i.e. PROTEIN) that is released from the alpha-cells within the pancreatic islets. Glucagon travels through the blood and acts predominately in the liver on glucagon receptors. The glucagon peptide binds to the glucagon receptor on the OUTSIDE of the cell and transmits a signal to the INSIDE of the cell. This occurs when the glucagon binds to the receptor, changing its conformation or "shape" on the inside of the cell, which then causes binding and activation of a G-protein inside the cell ($G_S$). This $G_S$ protein activates an enzyme within the cell (adenylyl cyclase) to increase the concentration of a substance called cyclic AMP (aka cAMP) that activates a number of enzymes that ultimately increase the amount of glucose released by the liver. These effects are IMMEDIATE effects, which is why we sometimes give glucagon injections to treat patients with hypoglycemia (i.e. dangerously low blood sugar concentration). However, sustained glucagon signaling likely has effects on the expression of the enzymes that cause the glucose to be released from the liver as well (though that is a discussion for another question). 



Cortisol, pictured above, is a steroid hormone (i.e. LIPID) that is released from the adrenal glands, specifically the zona fasciulata, which is the middle of the three 'layers' of the adrenal gland. Cortisol is referred to as a glucocorticoid and exerts its major effects through changing gene transcription in a variety of cell types. The way that cortisol does this is by binding its cortisol receptor, which is generally thought to be in the cytoplasm inside the cell. Upon binding of cortisol to the cortisol receptor, that complex is then transported into the nucleus of the cell where it binds DNA and can increase or decrease the transcription or expression of target genes. In the case of cortisol, these genes are for the enzymes that increase glucose production of the liver, and thus increase the body's capacity to maintain or elevate blood glucose. There is also some evidence that cortisol has additional effects independent of gene transcription, but that is outside the scope of this question. Regardless, the effects of cortisol on glucose metabolism are not immediate, but rather they take >30 minutes to several hours to begin to take effect. 

As mentioned in the question, both glucagon and cortisol affect glucose metabolism. Cortisol also affects the transcription of a number of genes involved in adipose tissue and lipid metabolism, as well as genes that are involved in protein metabolism and inflammation. Cortisol can be injected into a patient with an autoimmune "flare-up" in order to quell the inflammation, but those are different mechanisms of cortisol than its effects on glucose metabolism. A description of those effects is also outside the scope of this question, but could easily be read about in recent reviews on cortisol available on PubMed, e.g. Recent Cortisol and Fatty Liver Review.