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.
For International trainees – if you have already done post-grad, probably you have enough knowledge of Microbiology. However, you need to get used to or learn the UK system. You might need six months at least, preferably a year, to prepare for either part of FRCPath.
Please remember, this is only my opinion. You are the best judge of yourself and your preparation. Check the RCPath curriculum, do a gap analysis.
Collect your materials to cover the gaps in your knowledge, then assess how much time you might need to study.