This question has already been answered here: How to properly ask for store hours on phone?
However, I have one question. Can I ask the question like following?
How long does the restaurant stay open?
I would suggest that what you are really interested in is what time you have to arrive in order to be able to eat your meal. In that case you need to ask them both What time do you close? and What time is last orders? so you know exactly what you need to do. It is no good arriving at a restaurant which closes at 2345 at 2330 when last orders is at 2230.