The two sides had been at odds since Aug. 2, when talks broke down over CBS's demand that the so-called "retransmission fees" be increased in order for Time Warner to continue carrying its signal. Time Warner wanted to also receive CBS programming for its digital outlets without paying additional costs.
Under the agreement, programming on all networks resumed at 6 p.m. EDT (2200 GMT) on Monday, the two sides said in a joint statement. The agreement covers CBS's Showtime premium cable channel as well.
Financial terms of the deal were not disclosed.
Talks intensified in late August, according to a person with knowledge of the negotiations, after CBS Corp began airing ads in the three markets that urged fans to switch television providers.
(Read more: CBS win squeezes Time Warner Cable's margins)