Hi Frauke,
Glad to hear that you are getting paid eventhough you have no classes!
I can't tell you about Spanish employers as I have never worked in Spain but I think that you should tell them in advance. What does it say in your contract about quiting? Probably you have to give them some notice in advance. I am curious in knowing why you would want to leave? Have they been bad to you or you have a better offer? Either way you should check their contract and tell them in advance.
Also keep all the receipts and if they don't pay you then you need to show the labour office that you worked there so that they can follow some actions to get your money. That's IF they don't pay you. Do you really think that they won't?
I hope that it works out ok for you. Leaving in the middle of a contract can be troublesome and in the end of the day you want to make sure that you leave on good terms with a nice reference and maybe they might offer some work again in the future!
Best of luck and let us know how you get on