If your application for a permanent residence permit has been rejected but you have been granted a temporary residence permit, you can apply for a permanent residence permit the next time you apply for an extended permit.
If your application for an extended permit has also been rejected, you must prepare to leave the country.
The decision states what to do if you want to appeal.
You can read more about what happens after a rejection decision by selecting the permit you applied to extend at the same time as you applied for a permanent residence permit, on the page:
You have received a decision