"We cannot succeed with a date certain," the Arizona Republican told ABC's "Good Morning America."
"You cannot tell the enemy when you're leaving, when you're in warfare, and expect your strategy to prevail," said McCain, a former Vietnam era prisoner of war who lost to Barack Obama in the 2008 presidential election.
McCain also said in the nationally broadcast interview that he has full confidence in Gen. David Petraeus, chosen by President Barack Obama to succeed the ousted Gen. Stanley McChrystal as the Afghan commander. But he also said he thinks more U.S. forces are needed there.
McCain said he considered it "completely understandable" that Obama dismissed McChrystal in the wake of disparaging remarks the general and his aides made about civilian officials in a Rolling Stone magazine interview. He said that in a talk he had with Obama, "I pointed out to the president, we need a new team over there as well, perhaps at the embassy, and other areas." McCain said "the relationship between the civilian and the military is not what it should be."