The previous answers are somewhat dated information.
If you go or have been made bankrupt since 1st April 2004, bankruptcy now only lasts for 1 year. (This is an automatic discharge - and applicable if you have carried out your duties under the insolvency act).
The fact that you have been made bankrupt will however remain on your credit file for 6 years.
To add to Vic's answer, if you are deemed to have committed some bankruptcy offence (for example, by not co-operating with the OR, or trading while insolvent) you can have a Bankruptcy Restriction Order and discharge can be delayed by anything up to 15 years (for really horrendous cases).