A Switch is a role that can choose at Night whether to enable or disable all roles of a given type. For instance, a Doctor Switch can choose whether all Doctors in the game would be effective on a given Night. If the Switch dies, the power associated with it is considered enabled for the rest of the game.
The most used role associated with Switch is Vigilante; historically, a Vigilante Switch is called a Tooth Fairy. The reason why Vigilantes are associated with Switches is that a bad Vigilante can single-handedly ruin a Town; with a Switch, the Town has some recourse against a bad Vig beyond finding and lynching it. By the same token, this usage of Switch can be extended to control any role that may bring harm to the Town if used improperly, such as Bus Driver.
With this in mind, Switches are commonly, but not necessarily, Town-aligned.
Compare and contrast Enabler, particularly in the case of Mafia Switches (see below).
Use and Power
As mentioned above, Town Switches are essentially "safety" roles that can potentially limit the damage a role can do. Whether it is wise to disable a role on any given Night is arguable, considering the philosophy that a role would not have a Switch attached to it if there were no potential for it to go dreadfully wrong. Given the rarity of this role, though, it is not out of the question to consider the possibility of it being used as a gimmick - one should consider the possibility that the role linked to the Switch is not present in the game at all.
Anti-Town Switches have historically been used to limit Town power roles until the Switch is found and killed. However, this is poor design practice - giving the Town a power role as they kill a scum further increases the positive feedback the Town gets from scoring a point on the scum.
If anti-Town Switches are to be used, a better design move would be one that limited power roles on both the Town's side and the Mafia's side. For example, a game may have a Doctor, a Mafia Doctor, and a Mafia-aligned Doctor Switch; thus forcing the Mafia to consider whether it wants to give up its Doctor in order to stop the Town Doctor. The example becomes more intriguing if the Serial Killer is made the Switch instead, as the SK has its own agenda; this idea is used in the Switch setup.