I know an H1B that switched jobs 3 times in the US. The rule is you need employment within X days of the loss of your job but you are NOT tied to a specific company.
However changing jobs does slow down your Green Card process as some of the paper work has to be redone when you join a new company.