First of all, you are to be commended for caring enough about your employer that you wish to leave on good terms and in a moral and holy way. Clearly, they are losing a great asset.
There are many laws about the mutual employment responsibilities of both employer and employee in Jewish texts. Employers must pay on time and according to contractual agreement. They may not deduct from an employee for normal course-of-work damages and incidentals. And they must provide benefits like medical care, meals, breaks and vacation according to the customs of the city in which the workplace the business is located. Employees are expected to complete the labors they agreed to, arrive and depart according to the customs of the workplace, and not steal from their employers. For more, see the Talmud in Bava Metzia, 76-78.
Pursuant to your question of how much notice should you give, the Mishnah in Bava Metzia 7:1 reiterates the concept in labor relations that ‘everything is according to local custom’. In America, it seems to me that most people consider two weeks notice for quitting acceptable, and four weeks to be the most respectful, if possible.
The way to quit in a moral and respectable way is not a topic broached in Jewish law specifically, but the Torah gives an excellent illustrative story. In Genesis 31, Jacob, who has been cheated over and over again by his employer and father-in-law Laban in the course of 20 years of labor decides to quit. He agrees with Laban to divide their flocks of sheep, but Jacob schemes to take all of the good sheep and leave Laban the weak sheep. He kvetches to his wife that Laban “has cheated me and changed my wages ten times” (31:7), but does not convey his frustrations to Laban. Jacob takes his flocks, wives and children and leaves in the middle of the night. Laban chases him down and exclaims, “Why did you secretly flee on me, without even telling me, for I would have sent you off with joy and with song, with drum and with lyre…” (31:27).
Jacob then emotionally unloads; he tells of all the injustices of 20 years of labor for Laban in one seething diatriabe. Laban, either in anger, shock, or genuine selfishness, replies “The daughters (Jacobs two wives) are my daughters, the children are my children, the animals are my animals!” (31:43). The two make a covenant, mend their spat, and part ways for ever.
You are free to draw your own conclusions from this text. My take is this:
1) When you take your work with you, make sure your employer knows exactly what you are taking and agrees to it. Whether you leave with the healthiest sheep or are taking the secret plans to the next Toyota Prius, if they down know, it might be immoral (and it’s probably also illegal).
2) When you leave, save your co-workers your behind-the-back gripes. Go out with dignity, not like Jacob.
3) Set a date to leave, work until then, and go. Don’t sneak out in the middle of the night or call in sick for your last two weeks.
4) If and when you think your employer can hear it, set a meeting to discuss why you are leaving. A good company will want to know why its quality employees do not want to stay. Conversely, a lousy company won’t care what you say, and it will only validate your reasons for leaving. If you think your employers will be unable to hear your respectful explanation, plan B would be to write a letter shortly after you have left.
5) Lastly, and this is from experience, don’t expect to be played out ‘with drum and with lyre’, even if you were employee of the year 10 years running.
Good luck and many blessing at your next place of employment.