The longer they stay, the more resources they occupy and more money they make perhaps...and Pakistan having no say or share of the gas/resources pipelines.
I think we as a nation are very very delusioned and misinformed about the realities of this war.
What resources are there in Afghanistan? Don't forget that even if there are resources, then the money they make from it will be transferred only to the rich class.
U.S as a country is collapsing. It will be hard for them to run this war. Just look at their debt. I don't think they can pay it off even after 50 years. Hence the reason why is because of the fact that money is not flowing properly and not shared equally among all Americans. As long as they have this capitalistic system, the more damage it will do to them.--- Again this is my best of my knowledge.
However, i do see the fact that Americans have a very egoistic attitude. You never know they might stay. Historically, if they fail going into one country, then they will just try going into another.
Afghanistan is critical for them. As mentioned by 'Hummnist' here in this thread, it is strategically best to keep a check on Pakistan, Iran, Russia, China. If they are having a tough time, then they might even consider going into weaker countries like Tajikstan, Uzbekistan, etc... The geographic locations of these countries are quite similar.
They have attempted to go a bit south, not too far from Afghanistan. Yemen, is part of America's new deal. They are trying every thing possible...
So staying or not staying. These are my possible predictions from all case scenarios.