One doesn't "need" any set amount of time in any place (pet peeve alert), but these cities are all markedly different from one another. Berlin offers Cold War history unlike any other place, along with very important museums and very different neighborhoods; overall it's kind of gritty. Food tends to be very cosmopolitan, as there's no distinct Berliner cuisine so far as I could tell. You'll find numerous examples of cuisines such as Vietnamese, Nepalese and burgers-n-fries American.
Munich is a wealthy, pretty expensive city where residents appreciate and honor traditional styles of dress, comportment and behavior; great shopping if you're into that. There is a definite Bavarian cuisine, and both beer and wine from the region can be excellent. This is by far the most orderly and, arguably, civilized of the cities.
Prague offers magnificent architecture and natural beauty, along with a different memory of Communist rule compared to Berlin; it's also much the least expensive of these cities. Food tends to be very Slavic: lots of schnitzel, pork knuckle and dumplings, along with ample opportunities to try game meats. Art and music scene in Prague is magnificent.
Only you can decide which offers more attraction, and therefore time. But keeping intercity travel duration to a minimum is critical for a visit of this duration. Best wishes; these are three great cities!