For the scientists it was 5 years, for Wanda it was much shorter. She fades in Infinity War, comes back and fights Thanos in Endgame, and then finds out Vision is disassembled and being tested on. Wandavision is set 3 weeks after the end of Endgame, so we are seeing fresh wounds.