I’ve had a few dream jobs, but things change over time. For awhile each one was amazing, then either I changed/wanted something different or the company/role changed and it wasn’t a dream job any longer. For me there was no number of years attached to it. What I thought of as a dream job right out of college is completely different than my mid career dream job and long term dream.
My best jobs lasted less than 2 years. Even in a shitty place you can meet a challenge, excel, and leave, making some great impacts, without having to suffer from the culture long term .... The longer you stick around the more time the company has to screw you.