If the country votes in the referendum to leave the EU, do we actually have to do it?

Isn't this to gauge opinion rather than actually make it real.

Anyone explain to me (as a political dummy) what the procedure will be.