It's not a "condition" at all, but just an overactive imagination coupled with a penchant for daydreaming.
The movie was based on a short story by James Thurber. In the story, Mitty accompanies his wife on a mundane shopping trip. To pass the time, Mitty has a succession of 5 "heroic daydreams", each of which parallel a situation he is in on his trip. It's sort of like that old adage, "Hindsight is 20-20", where you sort of imagine to yourself how a certain situation or conversation should have played out to your benefit. That's basically what he's doing, only in a very grandiose way.
in 1947 it was adapted for the screen, with Mitty being portrayed as "henpecked and harassed by everyone in his life including his bossy mother, his overbearing, idea-stealing boss Bruce Pierce, his childishly dimwitted fiancée Gertrude Griswold, and Gertrude's obnoxious would-be suitor Tubby Wadsworth and loud-mouthed mother, Mrs. Griswold." (1)
In this movie, he imagines all sorts of interesting lives he could be living which are extensions of his current life. Again, just more or less daydreaming about living other lives. The 2013 version of the movie was more or less the same idea, with a slightly different storyline.
If you ever saw the HBO show Dream On, it was very similar to this idea, except the daydreams were only a couple seconds long and were just short scenes from actual TV shows and movies. I loved that show, it was very creative. :o)
(1) Source: The Secret Life of Walter Mitty (1947 film)