They keep them going as long as they are profitable. They track a metric called “store contribution” which is the profit sent to corporate after all the store expenses. The highest volume stores are grossing about 40+k/week with contributions in the realm of 500-700k/yr from one example I know of.
Moderate stores are doing around 25k/week. Stores below 10-15k/week tend to be at risk of shutting down or having the location changed. A 15k/week store can become a 30k/wk store just by getting a drive through.
There is also a distinction between “community” stores and higher volume profit stores (eg by highway entrance). Community stores get to be a little less profitable but build a “second home” for those in the community to hang out at, while non-community stores bring in profit by being in a high traffic area.