Spent 4 years at one job after college and I've switched nearly every year since 2021 chasing the bag.
My current job will be the only job I've been at longer than a year, but I already know when I'll be leaving this one since we have a goal of selling the company by 2026.
stability in job if other parts of life are chaotic. like if you are working full time and going to grad school part-time. having the stability and familiarity of a job/company you have been at for a long time can be helpful! or if you just had kids.
also, you can build strong relationships with people in a single company the longer you are there. i think a big part of this discussion hinges on the company's culture and size.
if it is small company then the value of staying long time is probably less. people at my company have gone from intern to CEO (which is not likely) and others who have been with the company for decades have climbed to exec leadership
guess it depends what ur priorities are, if those things aren’t an issue for u and u value money more then job hopping is the move