You can resign from your job. There are, however, a few things to consider if you are planning on resigning.
If you resign, you must in principle take into account the notice period. For an employee, the statutory notice period is one month. However, a different notice period may have been agreed upon in your employment contract. Please note that notice of termination is to be given with effect from the end of the calendar month. Thus, if your notice period is one month and you terminate your employment contract on 15 March, your contract will end on 30 April.
If you have a temporary contract, you cannot always terminate your employment contract before the set end date. Premature termination of a temporary employment contract is only possible if this has been agreed in writing. If your employment contract, however, does not include a premature termination clause, you will need permission from your employer to prematurely resign.
Note: If you resign, you will usually not be entitled to unemployment benefits (WW-uitkering), since you are responsible for your own unemployment.