A magnet is anything that carries a static magnetic field around with it. There are lots of kinds of magnets. The ones you find most commonly are permanent magnets made out of some special metals, especially iron, or are mixtures of these metals and other stuff (like rubber or ceramics). Other kinds of magnets need electricity to flow through coiled wires to create a magnetic field. Some magnets are combinations of these -- they have wire wrapped around an iron core.
Even individual particles like spinning electrons have magnetic fields around them, so we could call electrons "magnets" too. Permanent magnets, in fact, are those materials in which the electrons mostly spin in the same direction. Most electrons in most materials are paired with other electrons spinning in the opposite direction, but some materials like iron have many unpaired electrons. These can give rise to net magnetism when they interact with each other so that they have lower energy when spinning in the same direction. Some materials have unpaired electrons which interact with others so they spin on average in opposite directions -- these make lousy magnets (we call them "antiferromagnets").
You can think of two requirements to making a standard permanent magnet. First, the electron spins have to have the right interactions to make them line up together. That means that the energy has to be lowered when they line up. Even then, they won't line up unless they are cold enough, just like water molecules won't line up to make ice unless they are cold enough. Now, once many domains of lined-up spins are formed, something has to make the domains themselves line up. Otherwise, the piece of magnetic material is like a collection of little magnets pointing different directions, so their fields cancel. Applying a big field from another magnet can line up the domain magnetic directions. In the sort of materials used for permanent magnets, those domain directions get mostly stuck, rather than relaxing back to point opposite directions.
The magnets which need electricity to flow are called electromagnets. A magnetic field can change when the current in the wires changes. I specified "static" above to exclude light as a "magnet", though. Light waves consist of oscillating electric and magnetic fields traveling at the speed of light, and I didn't want to include that in defining what a magnet is.
Tom J. (and mike w)
(published on 10/22/2007)