Switches (also called turnouts in the hobby, presumably to avoid confusion with electrical switches) are a way for trains to travel in one of two (or possibly three) ways.
Here are some common terms for parts of switches.
Switches allow a train to travel either down the main route or switch to a diverging route. A throw bar is connected to the points, which can move into either the main or diverging position. The diagram shows the points (and thus the switch) thrown to the main route position.
In the example above, a train moving left to right is said to "face" the switch (or in facing movement). By the same token, a train moving right to left from either route is making trailing movement. Here's the way to remember this: would the train have to move forward (because the front is facing the switch) or backward (because the trailing end is facing it) to take the diverging route?
At one point, the diverging route's closure rail must cross the main route's closure rail; the piece of rail located there (often a pre-manufactured piece of steel) is called a frog. Guard rails against the stock rails ensure that the wheels of the train stay on the proper side of the frog. Wing rails ensure that the wheels of the train are guided into the frog correctly. (If you get wing rails and guard rails confused, just remember that only in railroading do frogs have wings!)
The length of a switch depends on where the switch is located, and what sort of traffic will pass over it. Mainline switches are usually long and gradual, allowing higher-speed traffic. Switches in yards or industrial complexes might need to be tighter in order to fit within a limited space. This "length" is expressed in terms of a number, and this is the ratio of two distances, as shown in the diagram: the distance along the main route from the tip of the frog, and the distance to the diverting route's rail at that point. For example, a "Number 6" switch (or frog) would have a 6:1 (six to one) ratio. Put another way, if you were to walk six feet along the main route from the tip of the frog, the diverting route rail would be one foot to your side. The bigger the number, the more gradual the switch (the farther you would have to walk to have the diverting route be a certain distance away.)
Switches normally allow travel in one of two routes. There are also "three way switches" which are really just a pair of two-way switches built on top of each other so that the points of the second switch are located on the closure rail and stock rail of the main route. In real life, as in the hobby, "specialty" switches are more expensive, and they're only used if there's a strong need for the complexity. Yards, for example, are often squeezed for space, so fitting two switches into one the space of one might be justified. Because of the added expense (more than just one frog, for example) and the risk of derailing, railroads like to keep things simple out on main lines, where trains generally run at higher speeds.
Stub switches have much the same in the way of parts. They differ, though, in that they don't have points at the end of their closure rails. In fact, the closure and stock rails all end at the same place, the toe of the switch. The rails leading up to this point are referred to as throw rails because they, not the points, are connected to the throwrod. Throwing a stub switch involves moving the toe of these rails to line up with the diverging route(s).
As may be evident, the terms heel and toe are used to describe many parts of the switch. Switch points have heels (the end which is hinged and connected to the closure rails) and toes (the pointy, planed end, that press against the stock rails.) The throw rails of a stub switch likewise have a heel (the point at which flexing begins) and a toe (the end that is moved by the throwbar.) Consequently, this area is referred to as the toe of the entire switch. Additionally, the frog itself is said to have a heel and toe.