You can withdraw your offer anytime before exchange of contracts.
However, you should always consult with a conveyancing solicitor
before withdrawing your offer otherwise you could lose any deposit
you have made with your offer or even be sued by the seller for
damages.