In the field of sexuality, a switch is someone who can change from one sexual role to another.
In anal sex among men, a switch is someone who participates both in the penetrative and penetrated roles at different times - i.e. enjoys both topping and bottoming.
In BDSM, a switch is someone who participates in BDSM activities as both a top and a bottom. A switch will be the top on some occasions and the bottom on other occasions. Switches are very common; partners may switch roles based on mood, desire, or being with a different partner.
A 'switch' may be in a relationship with someone of the same primary BDSM orientation (two dominants, say), so switching provides each partner with an opportunity to realize his or her unsatisfied BDSM needs with others.
A person who engages in self-bondage can be viewed as taking both roles simultaneously.
The term switch might also be used to mean a thin wooden stick used to cause pain.
In BDSM, a switch is someone who participates in BDSM activities as both a top and a bottom or dominant and submissive.
For BDSM activities, it is more common that a switch will be a top with one partner and a bottom with another than to switch roles with the same partner.
However, it's also possible for a switch to be in a relationship with someone of the same primary BDSM orientation (e.g., two dominants), so switching provides each partner with an opportunity to realize his or her BDSM needs.