A woman may nurse her child up to age four (in some circumstances five). After age two, if the mother and child voluntarily cease nursing for three days or more, they cannot go back to nursing even if the child asks, unless it is critical for his or her health.
The halachic issue is the resemblance between nursing and more animal means of sustenance. That resemblance becomes a factor when the child is older.