Germany's allies could see the tide had turned after the failure in Stalingrad, and actively began to seek a way out of the war with secret negotiations with the allies. But I'm assuming the German's were under the influence of heavy propaganda, but when did they come to realize that the war was definitely lost?
The German citizenry you mean? Many in the German High Command, especially those not particularly taken with the idea of inevitable German victory saw the writing on the wall pretty early in the scope of the invasion. Franz Halder is notable, he was the head of the General Staff until 42, dismissed due to disagreements with Hitler. He made many rather pessimistic statements, even early in the war. In August of 41, he said about the Russian army "The Russian colossus has been underestimated by us, whenever we destroy a dozen divisions, the Russians replace them with another dozen". For German citizenry, once the Russians started their breakneck advance across Reich occupied territory, barreling across Poland, and ESPECIALLY into East Prussia, many German citizens felt what was coming. It reminds me of what Goring said "No enemy bomber can reach the Ruhr. If one reaches the Ruhr... you may call me Meyer".