The answer is Richard M. Nixon who was CIC at war from the time he took office on January 20, 1969 until he left 0n August 8, 1974. He was, therefore CIC at war for nearly five years and 8 months. He beats Lyndon Johnson who took office November 22, 1963 and served until January 19, 1969, a period of almost five years and two months.
Unless something unexpected happens over the next year and a half, that record will be surpassed by George W. Bush. He has served as a CIC at war from September 11, 2001 until today, a period of four years and two months. He has more time in service in that capacity than Woodrow Wilson, Franklin Roosevelt, or Abraham Lincoln.
Only Johnson served out the two terms of office during which he was a CIC at war, leaving office at age 59. Wilson completed his second term, but was not at war in his first. Roosevelt was CIC at war during his third term, but died at age 62 after one month of his fourth. Lincoln was killed at age 56 one month into his second term. Nixon resigned at age 62, one year and eight months after his second term began. Wilson had a stroke at age 63 when he was midway through his second term, was incapacitated, but survived until age 66 after leaving office.
George W. Bush is 59, and in apparent good health, but history has not been kind to his predecessor CICs at war.
The Obama-Hillary Libya debacle
2 hours ago