At the federal level there are is a lifetime cap of 7 years, and no more than 3 years consecutively. There are exceptions to this for battered women (and men I guess), the disabled, veterans, and a few other cases. Many single mothers who are on welfare are also battered women (despite what you may thing, not many women opt to be single mothers just to stay on the dole).
Individual states can also have either own policies to extend or restrict benefits.