There is no official age when you can leave home. As long as you can show that you are living in accommodation that provides a safe environment (e.g. you are not at risk from drugs prostitution violence etc.) and you have a stable respectable method of supporting yourself financially, there are no legal barriers to leaving home at 16 years or older. If you are under 16, your parents or carers have a responsibility to keep you safe and they could possibly get a court order to make you return home or into care. If you are aged 17, then this is still possible, subject to all the surrounding circumstances.
If you just run away you could be in terrible danger. There could be consequences for young people who leave home and get into the wrong company. Making the wrong move could ruin your life.
Remember it is NOT what you judge to be a safe environment but what the people/authorities responsible for your welfare think is safe. You should try and do this with their blessing if possible.
If there is a serious underlying problem at home, talk to someone else, a teacher, a trusted adult relation or contact the charity Childline on 0800 1111 (or go to their website at www.childline.org.uk).
Do not act in haste, get as much advice and help as you can before you decide what to do.