Author's Note: This series of questions arrived while I was at a conference. In the time between talks, I crowdsourced some quick (read: short, unsourced) answers. Thanks to the expert panel who provided their thoughts (read: my conference roommates), Kelly Zalocusky and Cora Ames.
There is a strong effect of context on memory recall. For example, you'll probably perform better on a test if you take it in the same room where you memorized the information included in the test. This presumably has something to do with you being surrounded by a consistent set of physical stimuli.
In the case of chewing gum, I imagine it would help a student's test performance only if she had consistently chewed gum while learning the subject material.
How does the brain encode memories in a context-dependent manner? We're not totally sure yet, but there are many labs studying this question. It seems to involve some overlapping processes: knowing where you are, knowing what task you're doing, forming new memories. This process will undoubtably involve the hippocampus, a brain region involved in both spatial navigation/localization and the formation of new memories. It seems likely that the cortex will also play a major role, as various groups have shown recently that neurons located in various regions of the cortex response to stimuli in a context-dependent manner. For example, I was recently chatting with a friend who studies cells in the brain that respond to particular sounds. He's found that by switching the context in which a sound is played, the ensemble of neurons responding to that sound shifts substantially. So the brain seems to care a lot about the context in which events occur, although how this translates into the formation and retrieval of memories remains unknown.