The referendum is not legally binding on the UK Parliament — necessary pieces of legislation would still need to go through Parliament to complete the withdrawal process, so who knows?
This site claims there would be a 2 year process of withdrawal:
http://www.bbc.com/news/uk-politics-32810887
If Leave wins, the Government will have no choice but to negotiate an orderly withdrawal from the EU. Failing to withdrawal after a Leave vote would destroy Cameron’s premiership and he would be replaced by Boris Johnson.