It is difficult to say how long you need as it very much depends upon you –
your method and speed of study,
whether you are working while preparing for the examination (Non-UK trainees; UK trainees – tough, you will be always working while preparing),
whether you are trained in the UK or familiar with the UK system etc.
For UK trainees – I would suggest you discuss with your educational supervisor. He is the best person to advise you if you are ready. I would consider giving myself at least six months.