By the time of the Japanese attack on Pearl Harbor and the subsequent American entry into World War II, Gerhardt was in command of the 56th Cavalry Brigade. Promoted to the two-star rank of major general in August 1942, eight months after Pearl Harbor, he was the first Commanding General of the 91st Infantry Division, an all draftee division, at Camp White, Oregon. In July 1943, taking over from Major General Leonard T. Gerow, he assumed command of the 29th Infantry Division, a National Guard formation which was then stationed in South West England in preparation for the Allied invasion of Normandy and had been there since October 1942. In preparation for the invasion, scheduled for the spring of 1944, the division trained extensively in amphibious operations. Major General Gerhardt was a hard taskmaster, a strict disciplinarian and considered by many of his men to be a martinet, who often became upset at small things such as a soldier not having the chinstrap of his helmet buckled. One famous story has him admonishing a soldier on the day after D-Day for dropping peels from the orange he was eating on the ground. He was intolerant of any dirt or mud being on the trucks, and would make soldiers stop and clean a truck under almost any circumstance. Major General Gerhardt was, however, a superb and driven trainer of soldiers and expected the same from his subordinates. He led the 29th Infantry Division throughout the fighting in Western Europe, from D-Day until the end of World War II in Europe on Victory in Europe Day. , Major General Gordon MacMillan and Major General Charles Gerhardt on the saluting base during the ceremony to mark the handover of Bremerhaven by British to American forces, 1945. Gerhardt was one of the European Theater's more controversial commanders. His critics held that he was lacking as a military tactician and careless with the lives of his men; often pointing to the astonishingly high casualty rate of the 29th Division, which, from June 6, 1944 to May 8, 1945, suffered over 20,600 men killed, wounded or missing. It was said that Gerhardt actually commanded three divisions: one on the field of battle, one in the hospital and one in the cemetery. He was also considered somewhat loose morally, as evidenced by a house of prostitution he established for his men near Rennes, France, which Lieutenant General Omar Bradley, the U.S. 12th Army Group commander, did not approve of and ordered closed. Gerhardt usually walked the line between approval and disapproval with his superior officers. After the war, he was demoted to colonel for reasons thought to be a combination of the 29th Division's high casualty rate and his moral lapses.
Postwar
Following the war Gerhardt served as the United States Defense Attaché to Brazil and in a post at Fort Meade, Maryland. He reattained the rank of brigadier general and was able to retire at his highest held rank of major general. He is buried at Arlington National Cemetery.