Read this:
http://www.immihelp.com/gc/employment/greencard.html
In today's dynamic market, many people want to know how long does an employee who receives employment based greencard needs to work for the same employer after getting he greencard. There is no precise answer to this question.
The law say that if the employee left within 2 years, the employee has burden to prove that he/she accepted the job offer in good faith and didn't intend to leave at the time of accepting permanent residentship. If it is more than 2 years, the burden comes to USCIS to prove that. The theory behind greencard through offer of employment is that an employee is accepting a job on a "permanent" basis. But "permanent" obviously does not mean for ever as it does not make sense. But it also does not mean that the person leaves the company the day he/she gets green card. Each case would be different depending upon employee-employer relationship. But in general, staying with the same company for about 6 months to 1 year should be enough indication of permanency. "Permanent" means that, at the time the employee becomes a lawful permanent resident, neither the employer nor the employee have any plans to change the employment relationship described in the labor certification or I-140 petition. If you leave too soon, USCIS may claim that you did not intend to take the job up on a "permanent" basis. If the employer(or even a jealous co-worker)is dissatisfied with yourself leaving too soon, they can file a complaint with USCIS and USCIS may either take any action or not depending upon the circumstances. USCIS also may find about yourself leaving too soon while later applying for Citizenship or petitioning for relatives.
If USCIS finds out that the employee was just waiting for his/her immigration to be complete before jumping to a new job, then they are likely to charge fraud. If, on the other hand, it appears that the employee really did intend to stay with the petitioning employer indefinitely at the time of immigrating, but a legitimate reason later developed for leaving(like employer's business took an unexpected downturn and the employer had to lay off workers), then there should be no problem.
Even if the employer does not mind employee leaving immediately after getting the green card, it is not OK for USCIS. Both employer and employee should have good faith to have that employer/employee relationship on a "permanent" basis.