The war actually came as a relative surprise to the average German - of course people had noticed that the military had been growing a lot in the years leading up to the war, but there was no communication from the government about there being a war anytime soon. It's quite telling that the general staff of the Wehrmacht wasn't even fully informed about Hitler's shenanigans most of the time - for example, when Germany left the League of Nations, Hitler didn't inform anyone ahead of time, he more or less came back from that and went "Oh yeah, we left the League of Nations now, just btw". He did have a tendency to go into things a bit willy-nilly, see: Operation Barbarossa.
Another thing to keep in mind is the Nazi's propaganda-machine - average Hans had been seeing it everywhere for the past 6 years, but none of it had really been war propaganda. In the months leading up to the invasion of Poland, said propaganda began turning out more anti-Polish fabrications and the like, but again - didn't prepare anyone for war. When it actually broke out, the German population was told that it was a defensive war instigated by Poland, as such it was fairly hard to estimate a length for this supposedly defensive war.
If we are talking about the German government and high command, however, they were expecting a war of similar length to WWI, with slow fighting in the west. For the General Staff, the war seemed unwinnable after France and the British Empire joined it, the German defenses in the west were weak and almost half of their ammunition had been used up in the invasion of Poland (especially the Luftwaffe had been quite generous with their bombs).
In summary: Average Hans had little to no clue about how long this war, which was apparently a defensive war, would or could last. High Command expected something between WWI Part 2: less-monarchic boogaloo and relatively swift defeat. Hitler was being Hitler,going All In and hoping for the best (see: The infamous 'Va banque'-quote).
By: a student of history with a focus on German history, can pull up sources if need be.