This depends on how many numbers are in the area code. Some cities and towns have five, some of them have four (e.g. Leeds area dialling code is 0113, so the number should be written like this 0113 xxx xxxx) and some have three (like London 020 xxxx xxxx).
I found this link, hope it will help.
UK telephone code misconceptions - Wikipedia, the free encyclopedia
Please note I am not a teacher :)