FWIW I gave 5 weeks notice at a job a decade ago and immediately regretted it - the last few weeks were beyond awkward as I'd already wrapped up all my projects, spoken to all my colleagues and clients, etc. I was waiting for the job to end but kept getting roped into last minute projects that I could not in good faith contribute to because I was, admittedly, just sitting around waiting for it to be over. Everyone lost.
2 weeks max is optimal and expected for everyone. If you're feeling pressured to give more time to the company after resigning, say no and stick firm to 2 weeks. If they've got actionable work and you're able (i.e. not exclusively employed immediately thereafter), give them the option to hire you as a contractor. If the work is actually valuable, they should have no problem cutting you a check to complete it as a consultant. If not, well they're lying to you and stringing you along to extract any value they can - and you should leave in two weeks if not sooner.