At any point during studying, is it okay to just give up?
If you cram right up to the moment of the exam you will probably perform sub optimally. You will probably remember only what you studied last, not what you learned overall. Give your mind and body time to decompress before the exam. A day might be appropriate. Your mind won't quit working just because you aren't trying to drive it unmercifully. 

In general, take regular breaks if you have a long study regimen such as for a qualifying exam. An hour or so every few hours. Use some physical activity to get your blood moving and to get  you breathing hard. Then you can return refreshed to study. 

It isn't giving up. It is just using your capabilities more efficiently.

This sort of thing has been studied extensively.