An interviewer will ask this type of question seeking the information the question requests but also testing your integrity. While they may be genuinely interested in whether you enjoy working long hours were willing to do it, they also want to see all honestly you will respond to this question. Working long hours may or may not be a requirement for this job. You should respond with an honest answer, but more importantly, be able to justify your response.
"While I don't necessarily enjoy working long hours on a project, I am more than willing to do this if the situation requires it. I understand that sometimes it is necessary to put in extra time to complete a project on schedule. If I have to do this, I balance it out by taking some personal time off to make up for the additional time I had to work."
"Working long hours on a project is part of this job. However, I try to avoid this by carefully planning the work before starting a new project. I stay very focused while working on a project to be as productive as possible. Proper planning an intense focus usually helps me get the work done per the schedule created for the project. If I do have to put in some extra time, I do this willingly, knowing that it's required. I then try to allocate some additional personal time to maintain my work-life balance."