This becomes an obvious question if there has been a gap in between your past work experiences or between your last employment and this job hunt or even if you have remained unemployed for a long time. They seek a justification rather than answer to this question. Your answer should be able to convince them with a satisfactory reason. As an employer, this is a matter of concern for him.
 If your CV reveals presence of any such  gap in your career, then, keep your answer to this question ready. Follow a few  guidelines while preparing your answer:
  1. Be honest. Speak the  truth. 
  2. Tell that you had taken time off to develop a  particular skill, if it is so.
  3. Awaiting for a job  opportunity in a good company unlike your previous employer, is also a genuine  reason for staying non-working for some time.
  4. Keep your spirit high and maintain an  optimistic attitude. [Remember it’s how you treat yourself that decides how  others treat you.]

Now, it’s time for 'participation':
*Assume that you are sitting in the interview room now.
*You have been asked to ‘Why have you not been working for so long’. Go ahead; give it a try on how to answer the same. Post your own answers and get them reviewed .

Why have you not been working for so long?