TNG's All Good Things is probably my all-time-favorite; with close-seconds to DS9's The Visitor and TOS's City on the Edge of Forever as runners up. Honorable mention to DS9's Far Beyond the Stars, while technically a vision/fever-dream it's one of Star Trek's finest hours.
Far Beyond the Stars is probably DS9's best episode IMO - but it's funny, I never considered it a time-travel ep before. I guess it fits that bill too.
Avery Brooks’ acting in that one is top notch either way.
I also suppose if we are counting it, then we should also discuss The Visitor. Tony Todd does such a great job as old Jake, and as a father myself, this episode hits the feels really hard. And then later Tony Todd is back as Kurn and there’s no way you could tell it’s the same actor, other than his voice.
The Visitor is probably my favorite, and in the running for my favorite episode. I remember when I put that episode on, innocently all ready to enjoy another episode of DS9… 45 minutes later I’m basically sobbing in front of my tv lol. The beautiful thing is it probably wouldn’t have hit as hard if they didn’t do such a great job of setting up Jake and Sisko’s relationship leading up to it. Not to mention the performance from all three actors. Watching their faces as they interact with one another is incredibly convincing and just pulls you fully into the scene emotionally.