Once you apply for a green card, you have to maintain legal immigration status continuously. Furthermore, nationals of India and China have to wait longer, due to country quotas and relative demand. There is something called a priority date, which is somewhat akin to taking a number instead of waiting on queue, except it's really more like a number for the secondary queue to get a number for the real queue.
There is an I-140 form that is part of the process, which is filed by the employer. If this form is withdrawn, perhaps in response to changing jobs, it can reset priority dates or cause extensions to be denied.