Let's just get this out of the way first before things get awkward: breastfeeding is ultimately between a mother and her child. Although fathers play a pivotal role in raising and caring for their child, since it's the mother's body actually providing the sustenance, deciding when and how to wean should be mostly up to her and your child. Weaning is often a hard subject to approach for nursing moms, but when the time comes, there are several ways dads can and should help with weaning, because they may need some extra support.
The World Health Organization recommends exclusive breastfeeding for the first six months and then continuing (along with complimentary solid food) for the first two years of your child's life or beyond. Though this may seem like a long time to some (especially if you're not the one physically breastfeeding) two years is actually shorter than the average child nurses in most other countries around the world, according to La Leche League.
There are no "rules" about how or when to wean, and each family must decide for themselves what works for them, but generally speaking, doing it gradually is best. And when the time comes for your child to wean, your spouse's support and acceptance will be crucial.