A switch is used to connect a number of computers or network devices together. A switch also has intelligence in it so that it only sends information to a port (outlet or connection) that belongs on that port.
Switches are devices that will allow you to connect a number of computers together so they will have a number of spots to plug the network cables in. It can also be for receiving a number of wireless connections.
Switches that consumers use usually have four ports (or outlets) to plug network wires in from PCs. Commercial switches will have 8, 16, 20 or even up to 48 ports.
You will often find that the router is combined with a switch which is what you really get when you buy what is called on the packaging a DSL modem/router o cable modem/outer.
Switches are also made for other media than network (Ethernet/CAT5/6) cables. You can get switches that connect USB cables together.
Hubs are similar to switches. Hubs also allow you to hook a number of cables together. However hubs are dumb and all traffic goes out all ports. If you gave a choice of a hub or a switch you want to get a switch. A switch will run faster than a hub since traffic limited to what belongs to that device. Networks that still have hubs (hubs were the way to connect networks together until soon after 2000) will significantly speed up by just replacing a hub with a switch.