I think that asking about it (yourself and us) means that you are unhappy in the career you are now. So we already know you want to change.
When is the right time, probably, as soon as possible, given certain conditions. The fact of the matter is that the older you get the harder it will be to get a new job.
So, what kind of things you should think about before quitting your job?
First of all, since you aren't happy in what you do now, do you have any idea of what you want to do next? would that require going back to school or training or learning new skills? If it does, then it might be better to go to school part time while still keeping your old job.
Second, can you afford the change? do you have young kids or other people who are dependent on your income? are you paying a mortgage on a house? what are your financial obligations? Most of the time, starting over mean having a dramatic pay decrease for a while being that you still don't have experience in the new field. You should either have savings to relay on, or an income from another resource (like a wife that have a job that can support the two of you while you are learning the ropes, or a property you can rent out or an investment).
If you can handle the financial obligations and you know what you want to do now - just go for it!