Under normal circumstances, it is best to give a two-week notice. However, you may have to give notice on the spot (and you are entitled to do so).