How do I know when to stop breastfeeding?

Up to you. There is no medical reason to stop breastfeeding at any age; I've been asked if there is a reason to wean a school age child, and the only one I could think of was that other children would laugh at him. Your own considerations -- job, lifestyle, other children -- usually dictate this decision. Having said that, benefits of nursing become rather small after the age of 12 months.
Depends. I find that 6 to 12 months is the window that moms find satisfactory and the first 6 mos is the most important in re immunity. After 12 months the weaning gets much more difficult to do. So, I advise my pt after 6-12 mos when they are down to a few (no more than 2-3)feeds a day, arrange a weekend away, then tell the child no more! A little break makes it less difficult for both parties.
Breast feeding. New recommendation - breast feeding till age 2 years if possible (based on different factors).
Your choice. The american academy of pediatrics recommends exclusive breastfeeding for 6 months and if possible up to 12 months. After this time period it is up to you how much longer you want to nurse.
Two years. As a rule of thumb, two years is a good enough time to wean your baby off of breast milk for several reasons; mobility of both you and baby as baby is in mobile mode, need for extra nutrients like iron which is low in breast milk, need for texture in mouth, and regularized bowel movements and help in potty training as roughage is needed, off course societal norms and pressure.