The two sides had been at odds since Aug. 2, when talks broke down and CBS, Showtime and other CBS-owned channels were blacked out in New York, Los Angeles, Dallas and other smaller markets.
In addition to higher retransmission fees, CBS also had demanded to be paid for the digital rights to its TV shows. Time Warner wanted to receive CBS programming for its digital outlets without paying additional costs, which would extend a provision of their 2008 agreement.
CBS has since received payment from Comcast and other cable operators for the digital use of their programs. (Disclosure: Comcast is the owner of NBCUniversal, the parent company of CNBC and CNBC.com.)
"We are receiving fair compensation for CBS content," CBS chief executive Leslie Moonves said in a statement. "And we also have the ability to monetize our content going forward on all the new, developing platforms that are right now transforming the way people watch television."
(Read more: CBS ad enlists football stars in bid to end Time Warner dispute)
The agreement will almost certainly continue to reduce Time Warner Cable's margins, which have narrowed for the past decade as program costs have increased faster than operator's ability to raise rates, said Michael Corty, an analyst with Morningstar who follows Time Warner Cable.
"The video margins are still substantial, but cable operators are having to make it up more and more from broadband sales," he said.
Other cable operators such as DirecTV which had backed Time Warner Cable in its standoff with CBS will be looking closely at the deal as they struggle against rising program costs.
Later this year, satellite operator Dish Network's contract with Walt Disney expires, which will require negotiations over increases for channels including sports channel ESPN, the most expensive channel on the dial.
Under the agreement announced over the weekend, Time Warner Cable will be able to offer an app for CBS's Showtime premium channel on its digital services, the two sides said in a statement. But analysts believe that the cable operator will be paying for the rights to any digital content.
CBS frequently mentions digital licensing of its content as one of the major drivers of earnings growth for its TV properties in earnings reports and conference calls.
"We wanted to hold down costs and retain our ability to deliver a great video experience to our customers," Time Warner Cable Chairman and Chief Executive Glenn Britt said in a separate statement. "While we certainly didn't get everything we wanted, ultimately we ended up in a much better place than when we started."
Programming on all networks resumed at 6 p.m. EDT on Monday, the two sides said in a statement.
Talks intensified in late August, according to a person with knowledge of the negotiations, after CBS began airing ads in the three main markets that urged fans to switch television providers before the start of the football season.
The ads, which feature a much-anticipated match-up between star sibling NFL quarterbacks Peyton and Eli Manning, were designed to highlight what Time Warner subscribers would miss should the blackout interrupt viewing of the football.
Eventually, fights that lead to rising program costs could bring in federal oversight from consumer-minded politicians and regulators, said Richard Greenfield, an analyst with the firm BTIG.
"Change is coming," Greenfield said in an email. "2014 will not be like 2013. Broadcasters shouldn't get too smug with this victory."