I gave 4 months notice once, at a 15-person company where I was the lead of a 3-person team responsible for everything technology at the company. My boss was the sort who would tell people to leave immediately, and happily pay the 2 weeks they intended of notice. But I was critical to the functioning of the company, and I was able to hire and onboard a successor. I continued consulting part-time for a while past the end of my employment, it was good for everybody. I've never worked at a job where I would afford the company such a luxury of my time.