Can it last forever?
The shutdown continues until a bill passes both houses and is either enactes by the president or passed through the veto override procedure. Theoretically, the stalemate could never be resolved, and the government might fail or something, or maybe 2/3 of the state legislatures call for a constitutional convention in order to try to fix the problems. None of that seems terribly likely given the political incentives, but in the American system, there is no higher political power than Congress and the president under the Constitution.
Practically speaking, though...
At some point, one side or the other will give in. This is a game of chicken, just in the halls of Congress instead of the school playground. The entire House will be elected again in two years, so the probability of a shutdown lasting beyond that is essentially 0. Each party knows this, and so they each want to end the shutdown before it becomes politically precarious.
The key problems right now are that the House and Senate are run by opposing parties and that the Senate must invoke cloture on any funding bill, i.e. the Senate must have at least 60 votes to end debate.
Speculation
If I were to make a guess, I'd say that invoking cloture on a bill funding a wall at $5B is the biggest hurdle, since it would involve seven Senate Democrats defecting. Maybe Mitch McConnell could convince a few of the more centrist or conservative Democrats like Jon Tester (D-MT) or Democrats from "red" states like freshman Kyrsten Sinema (D-AZ) to support a bill with wall funding. Absent a deal between Trump and Schumer (D-NY), the Senate is going to be a hard sell.
I think the House may actually be a bit easier, since the Republicans would need only to make a deal with the House leadership to bring a wall-funding bill to the floor and then get at least 18 Democrats to support it.
In percentage terms, only 8% of House Democrats would need to defect to pass the wall funding as opposed to 14% of Senate Democrats.