How to professionally quit a student job? I'm a CS master student in a German university currently writing my thesis. Three months ago I saw an advert from a PhD student in the group where I'm doing my thesis asking for a student assistant (HiWi) to work on a programming project. I went  and said I'm interested in the job but specified I can only work 5 hours a week since I must work on my thesis. It was agreed  saying "I don't care how much time you will take to finish it".

Since I'm writing my thesis and was about to finish when asked: "how long are you staying here" and I said that I don't know yet and asked why; the reply was "because now I'm concerned that you might leave me if you finish soon" and I mentioned that I will stay to do my PhD.

So I started working. After the first week I noticed that the Phd student is actually quite weird. Once I mentioned that I'm going to use framework "X" for a particular part of the project, and was told: "No I want you to use framework Y, because what if you die then I have to continue doing the project". I didn't like how it was said, but I considered it a joke. Then the weird stuff continued. I won't mention them because it will take too long.

Because of administrative issues they couldn't start my contract for two months, so I worked two months for free. It was said that for the coming months they will put more hours in my contract and I can skip some weeks without working so I can make up for the two months.

However the most annoying thing happened 4 weeks ago. I was told that we need the project done earlier than thought (never mentioned any deadline previously). Then I thought OK I will work twice the time (10 hours a week) for two weeks and then once I finish the main functionalities in the project I will ask to skip two weeks so I can make up and work on my thesis.

Surprisingly after those two hard weeks I was told  that  the project is wanted done by the end of next week! I said that I was already working overtime and was replied "I don't care I just want it to be done by the end of next week because I have a workshop and I need to present it"! 

That was the time I made the decision to quit since it was known very well that I can't do this because I have to work on my thesis, also because of the Phd student's weird behavior. However after receiving the shock I decided that it's not professional to quit at this stage since there is a deadline for the workshop. Also I finished 60% of the project and we made the deal to finish only until 70% for the deadline.

However I want to quit after the deadline but I have the following concerns:


The atmosphere in our work group is very familial. I have lunch with all PhDs and postdocs and jokes and everything. I'm now concerned that quitting would make the atmosphere negative between us.
Whenever I think about quitting I remember when I was asked  about how long I will stay because of the worry that I might leave, to somehow not to screw up things. It's the main concern since the project will be 70% done and hiring a new student would be painful since they would have to read what I did and so on and will delay the project.
The professor is also concerned about this project and now I'm afraid that quitting this project at this stage would make my image look bad as a quitter. 


So how do you recommend me to quit this job?

Edit:

One way I thought of quitting is to go  after the deadline and say that I won't work for 2 weeks because I need to work on my thesis. Now if  told that I can't do that, then I will tell say "then I'm probably not a good fit for the requirement of this project and I don't want to be an obstacle for its progress. I think it's a good idea to find someone who is a better fit". Then I will pray that the response is "Yes you are right". The issue is that we have a lack of student assistants so he might still want me to work under my conditions, but I don't want to continue working for them!
It sounds to me like you don't exactly need to quit. Remind him of the conditions under which you took the job, and ask him to stick to the agreement. If he can't do so because his requirements have changed, then that's his choice. You might say something like this:


  As you recall, when I accepted this job, it was under the condition
  that I would only work 5 hours per week so it wouldn't interfere with
  working on my thesis. Because of your workshop, I have been working
  far more time than we agreed. I'm concerned that you need more support
  than the 5 hours a week I am able to provide. What do you think?


Note that I said "5 hours per week" twice for emphasis. Give him a chance to respond. At this point, if he promises to stick to 5 hours per week in future, and allows you to take the next few weeks off to catch up on your thesis, then perhaps you might give him one more chance.

However, if he indicates that he needs you to work more hours, or be available whenever he has deadlines, then you might say something like this:


  Unfortunately, I can't work more than 5 hours per week, and it sounds
  like that just won't be enough. Perhaps the best way to solve this is
  turn the project over to someone else. I'll do what I can to ensure a
  smooth transition.


Instead of "quitting", you're working with him to solve his requirements. If it turns out that the only way to meet those requirements is for you to hand off the work to someone else, then that's his choice.

As for the time you worked for free at the start of the contract, I think it is going to be difficult to get paid for that without burning bridges. Of course, you are entitled to be paid, and you could pursue that legally, but you may not want to. In future, remember never to work without a contract.