It is usually down to the discretion of the company. For example, you can cause problems by leaving midway through an unfinished project and this may lead to a bad reference, but the company will not want you slating them after you have left. Therefore most companies will be lenient depending on the work you have done for them and the general relationship you have had with your employers to date. Legally YES they can make you, but keep on good terms and they will probably let you go. It is a crazy length of notice for any job! If you hate it - why should they prolongue it by keeping you three months!