Depends on the situation. I think a two week notice and working to the end is the best thing to do in almost every case.
When I worked in Indiana and was planning to move to Arizona, I gave my boss a three week notice and then made a plan for those three weeks. I worked until 30 minutes after closing on the day before I left the state. I finished my list. My boss told me she had never seen anyone work that hard after giving notice and that she would give me a recommendation anytime.
My first job in Phoenix, I had big issues and problems with my boss, the owner. I walked off that job while onsite in Denver working on a contract. Packed my bags, knocked my boss's hotel room door and told him I was done. Only time in my life I've ever walked off a job. I don't regret it, though.