Broadly speaking, you need to leave New Zealand before your permit expires and remain away for the same length of time as you were here. For example, if you visit for nine months, you’ll need to stay away for nine months before returning.
But you may not be entitled to another stay of the same length. The length of any subsequent stay is dependent on how long you have spent in New Zealand in the period immediately preceding your application and whether or not you are a genuine visitor.