A short explanation
Each AS or A2 level is made up of different modules. If you sit a module and get the result before you get your final overall AS or A2 result, you will have the opportunity to resit that module before you get your overall result without penalty.
If, however, you want to resit a module for which you do not have the modular grade/UMS for until you receive your overall AS or A2 grade, things are a bit trickier.
If you don't decline the AS grade, any improved resit grades will count towards your final A level grade but will not change the AS grade you have already received. You must decline the grade in order to change the AS grade (which you can do even if your school has cashed in your AS). The deadline for declining an AS or A level grade is September 20th. If you haven't done it by then they will only consider 'declines' in special circumstances after that date. ~PQ
UCAS forms: If you decline an AS grade, you must put the entire AS qualification grade as "pending" on a UCAS form if you apply to UCAS before you have re-taken all the modules you want to re-take. You must also put the date in the future. This does mean that you can effectively hide the grade from the universities - but some high calibre universities are said to look dimly upon such methods.
Similarly, if you wish to re-sit an A2 module after you have received your A2 result you must decline the grade. Resitting a module may mean that you have to spend another year at school or college.
New Rules (from Summer 2007 onwards)
The summer of 2007 was the last time that anyone could decline an AS or A-level grade. From then on, it has not been necessary to decline your AS or A-level to resit a single module. It is thus now easier to resit a qualification. However, you will still need to cash-in repeatedly to get an overall grade from your units even though you do not need to break down an overall grade to take a resit for a unit. The new rules mean that unit grades can no longer be "hidden" from UCAS.