You may be able to prepare for some time while you’re still working depending on the kind of job that you have. I have seen people who work and prepare simultaneously through coaching and taking regular mock tests etc. but even they tend to leave; with at least 6–8 months to revise and prepare in earnest for the exam.
I’d say that if your job allows you to study for 4–5 hours a day then you can keep working. If it interferes with your preparation then you ought to leave