Breastfeeding

When can I stop breastfeeding my child completely without having to give a bottle of formula? Like when is milk not necessary anymore?