Magistrates have it within their power to impose a driving disqualification of any length (up to life) for any driving offence which carries an endorsement. Additionally, they have similar powers to impose disqualifications for non-driving offences, though these would usually only be used where the offence was related to or assisted by driving (fly-tipping and kerb crawling are two examples that spring to mind).
In addition to the �totting up� provisions already mentioned, some offences carry mandatory minimum disqualifications. Excess alcohol, refusing to provide an evidential specimen and dangerous driving are the only examples I can immediately think of. These all carry a minimum of twelve months. Causing death by dangerous driving also carries a mandatory ban, but this can only be dealt with at the Crown Court.
Outside of these statutory requirements, the length of any disqualification they impose is entirely at their discretion. When considering their sentence (in conjunction with their guidelines) they will take account of the seriousness of the offence as well as facts about the defender, particularly his previous convictions.
In practice it is unusual for magistrates to impose bans much greater than three years. In fact the only firm guidance they have on periods in excess of 12 months is for excess alcohol. Here, disqualifications of 16 months are recommended for those with 1.5 to 2 times the legal limit and this scale goes up to a recommended ban of 3 years for those convicted with more than about 3.7 times the legal limit.
Drivers who have been disqualified for periods of more than three years can return to the Court to have their disqualification reviewed after it is two-thirds spent. Magistrates have the power to reduce the period of the original ban if they think fit.