If you have not studied any theory course, you should prepare the exam for around half year that is enough. Every week has one hour lesson, do the exercises from your teacher or from music store.
The passing mark is 66. Basically it is a easy task to get Grade 5 theory pass
Of course, it will be much helpful if you have Grade 5 piano level