If you've been in your job for less than a month, you don't have to give notice unless the contract or terms and conditions require you to. If you've been in your job for more than 1 month, you must give at least 1 week's notice. It's best to resign in writing, so there's no argument about when you did it.