Static electricity is the imbalance of electric charge on a surface of a material. Static means fixed or stationary, therefore it is used in contrast to dynamic (moving) electricity which are in the form of electric currents.
Typically atoms are neutral, which means they have the same number of electrons and protons. However atoms become charged when there is an imbalance in the amounts of these particles, which can happen fairly easily for certain materials. The ability for a material to hold on to its electrons determines its place in the "triboelectric series". The farther two materials are ranked in this series, the more noticeable the charge separation is when they come in contact. For example glass and silk are relatively far apart in this series, so when glass is rubbed with silk it will lose many electrons to the silk, and static electricity can be observed.
Charge separation of two objects can be induced in several different ways.
Once an object has built up a charge imbalance, it will naturally want to become neutral once again. This happens by what is called discharging, which can commonly be felt by a shock when it happens to a person. Contact-induced charging is the most commonly experienced form of static electricity build up, as can be accomplished by rubbing ones feet on the carpet. Once enough charge is built up, there is a high enough voltage needed to cause the charge to jump from the person to a nearby doorknob leaving the person discharged and, if they weren't ready for it, quite shocked.
This same charge build-up and discharge process occurs in clouds to create lightning, and can be explored on Hyperphysics.
The University of Colorado has graciously allowed us to use the following PhET simulation. This simulation shows how charges get separated (but are neither created nor destroyed) when a balloon rubs on a person's sweater.
For further information please see the related pages below: