Although WandaVision constantly creates more questions than answers, one thing we do know is when it takes place. Thanks to a pair of plot points from the past couple of episodes, we can pinpoint the timeline of the show pretty clearly, despite all the wacky weirdness and retro sitcom settings.
WandaVision takes place in 2023 — specifically, about three to four weeks after the finale of Avengers: Endgame. Most of what we know about the timeline comes from the show's fourth episode, which revolves around S.W.O.R.D. agent Monica Rambeau and how she came to be sucked into Wanda's illusion world in Westview. Monica wakes up in 2023, like all the rest, five years after being "snapped" out of existence by Thanos back in 2018 (aka Avengers: Infinity War). After that initial scene, where she revives in a hospital only to find out that her mother, Maria Rambeau, died three years ago, we skip ahead three weeks to see her return to S.W.O.R.D. duty.
At that point, Monica is sent on the mission to investigate Westview alongside Agent Jimmy Woo, and she gets pulled into the "world" behind the force field. It's not quite clear how much time passes while she's stuck in the sitcom world, but she does get ejected fairly quickly, once she breaks the illusion and asks Wanda about her brother Pietro. This short time frame also suggests that it didn't take long after Endgame's epilogue for something to happen that sent Wanda spiraling: only nine days prior to Monica's ejection from Westview, Wanda broke into a top-secret facility and stole Vision's body. This, presumably, answers how Vision is "alive" within Westview at least. By that timeline, then, everything that's happened on the show so far has presumably taken place in a time frame of less than two weeks.
One other intriguing detail about WandaVision's setting: although it's the most recent Marvel project to be released, it actually is not the furthest forward in the in-universe Marvel timeline. Spider-Man: Far From Home takes place approximately eight months after Endgame, meaning that WandaVision's reality-bending exploits happened several months before the illusion-based villainy (and alternate-reality fake-out) of the latest Spider-Man movie. Only time will tell what's really going on, but we suspect it's not so simple as one straightforward reality.