You will want to season or re-season a cast-iron pan if food starts sticking or the pan turns a sort of dull color (which means food is likely to start sticking soon). According to Lodge Cast Iron, a manufacturer of cast-iron pans that's been around since William McKinley was president of the United States, to season your pan:
1. Preheat your oven to 350-400F. Line the bottom with foil.
2. Clean your pan with hot soapy water and a scrub brush and dry it really well. Spread oil over the entire surface (inside and out) of the pan.
3. Place the pan upside down on the top rack and bake for one hour. Turn the oven off and let the pan cool in the oven completely. (I often just leave it overnight).
After seasoning, do not use soap or detergent to wash cast iron: it will break down the oil seasoning. Hot water and a stiff brush should do the trick. Stubborn, burned on food can often be loosened by boiling water in the pan. Cast-iron pans should be towel-dried immediately after being washed to avoid rusting.