I heard this advice before and at 4 years I'm quite due for a change in the statistical sense, and I've been offered more money already but... I feel like I'm already rich with no expensive hobbies and the money just flowing into long-term ETFs for retirement. Am I just in an exceptional situation or does the advice still apply to me and should I leave within the next 1-2 years?
Just spitballing. If you really are 10/10 happy, and aren't concerned with the possibility of that company blinking out of existence and being screwed, I would probably just say ride with it until you feel like quitting.
But keep your resume up to date, and go on interviews from time to time. See what the offers are, and do the math on them. And if the math says "Stay put", ignore the techbros who disdain roots. :)
I work in a large European industrial company in aerospace, and the vast majority of the employees stay until retirement. Yes most change job regularly, even relocate to different countries, but within the same company. Outside options aren't great, you're not looking at large potential raises and will have difficulty finding as good of a package unless you go into another industry completely. If I was fired I'd probably have to move to a different country and get into another industry to get a good offer.
At the very least, preserve the option to come back. Be honest with your employer, tell them you enjoy the work but are just curious what else is there.
I'd say continuity is fine, if the firm is large enough to offer a career path.
It makes sense to stick around longer if you see yourself as a "knowledge worker" rather than as an interchangeable techie. It certainly makes sense from the company's perspective to keep knowledgeable people around.
I can't help but think that it's pathological to consider that "long" :/