There are companies which will have a security guard escort you to the door the day you give notice, and there are others which will want to retain some of your services on contract after you leave.
The amount of notice given should be appropriate to the circumstances.
I was in a similar situation and gave a month notice. It was awkward to stay that long. I would give them two weeks of your normal work along with one week of training for your replacement.