Routers: these devices connect different networks, operating at Layer 3 (the network layer) of the OSI model. They maintain routing tables which map IP addresses (more correctly, IP prefixes) to an outgoing interface. Note that an interface may contain one or more ports (See below).
Switches: these maintain forwarding tables which map MAC addresses to physical ports, operating at Layer 2 (the data link layer) of the OSI model. This is not necessarily a one-to-one mapping; many MAC addresses can be bound to the same physical port. This is the case where you have multi-layer switched networks (think a Netgear or Belkin switch plugged into your office or university network), or a hub connected to a switch port.
Hubs: these are essentially multi-port signal repeaters, operating at Layer 1 (the phyiscal layer) of the OSI model. They can be either unpowered (simply providing a physical connection for the existing signal to propagate along), or powered, where they actually regenerate and/or amplify the signal they receive. The point to note here is that hubs are a single collision domain. A collision domain represents a set of devices all connected to the same physical transmission medium, such that only one of them can transmit at any given time (ignoring multiplexing technologies like wavelength division multiplexing, frequency-division multiplexing, time-division multiplexing, etc etc.).
In practice, hubs are found less and less in today's data networks, as they have poor performance (as only one user can transmit at a time) and poor security (anyone connected to the same hub can hear everything all other users transmit and receive).
Modems: MOdulator-DEModulator. Responsible for establishing a digital channel over an analogue medium, most commonly the telephone network. Modems again operate at Layer 2 (the data link layer), but use different protocols than Ethernet to communicate. They then offer protocols such as PPP to the network layer, to allow IP traffic to flow over their links.
Unmanaged switches — These switches have no configuration interface or options. They are plug-and-play. They are typically the least expensive switches, found in home, SOHO, or small businesses. They can be desktop or rack mounted.
Managed switches — These switches have one or more ways, or interfaces, to modify the operation of the switch. Common management methods include: a serial console or Command Line Interface accessed via telnet or Secure Shell; an embedded Simple Network Management Protocol SNMP agent allowing management from a remote console or management station; a web interface for management from a web browser. Examples of configuration changes that one can do from a managed switch include: enable features such as Spanning Tree Protocol; set port speed; create or modify VLANs, etc.
Two sub-classes of managed switches are marketed today:
Smart (or intelligent) switches — These are managed switches with a limited set of management features. Likewise "web-managed" switches are switches which fall in a market niche between unmanaged and managed. For a price much lower than a fully managed switch they provide a web interface (and usually no CLI access) and allow configuration of basic settings, such as VLANs, port-speed and duplex.[10]
Enterprise Managed (or fully managed) switches - These have a full set of management features, including Command Line Interface, SNMP agent, and web interface. They may have additional features to manipulate configurations, such as the ability to display, modify, backup and restore configurations. Compared with smart switches, enterprise switches have more features that can be customized or optimized, and are generally more expensive than "smart" switches. Enterprise switches are typically found in networks with larger number of switches and connections, where centralized management is a significant savings in administrative time and effort. A Stackable switch is a version of enterprise-managed switch.
Source: http://en.wikipedia.org/wiki/Network_switch
I would explain in more personal detail, but the wiki explains it pretty well.
Best Answer
I will complete Zoredache's answer.
A L2 switch does switching only. This means that it uses MAC addresses to switch the packets from a port to the destination port (and only the destination port). It therefore maintains a MAC address table so that it can remember which ports have which MAC address associated.
A L3 switch also does switching exactly like a L2 switch. The L3 means that it has an identity from the L3 layer. Practically this means that a L3 switch is capable of having IP addresses and doing routing. For intra-VLAN communication, it uses the MAC address table. For extra-VLAN communication, it uses the IP routing table.
This is simple but you could say "Hey but my Cisco 2960 is a L2 switch and it has a VLAN interface with an IP !". You are perfectly right but that VLAN interface cannot be used for IP routing since the switch does not maintain an IP routing table.