How long should I breastfeed my child?

Breast feeding. That is a very personal decision, there's no real set time. Any amount of breast feeding is better than none. However, since children can start drinking whole milk, at a year of age, that's one time. Another is when the child can use a sippy, so they will never need a bottle. Some mom's nurse 2-3yrs, though. The benefits to mom, from breast feeding, are also found when nursing at least a year.
One year. There is no exact time that is going to be right for everyone, but most experts breastfeeding for one year. Some babies lose interest earlier and some want to continue longer. Each case needs to be individualized.