Can I change employers during cap-gap?
You can, if the OPT rules allow it, but the H-1B petition belongs to the sponsoring employer. If it is withdrawn, cap-gap ends.
Under the OPT rules, probably yes. Under the H-1B petition, the sponsor is the one that matters. A student on cap-gap can generally change OPT employers as long as the new job meets the OPT and STEM OPT requirements, but cap-gap ends if the H-1B petition is withdrawn, which the sponsoring employer can do at any time (8 CFR 214.2(f)(5)(vi)).
Two relationships
The student has an OPT job and an H-1B sponsor. They can be the same employer, and often are, but cap-gap does not require it. The sponsor files and controls the petition. The OPT employer is the one the student reports to the DSO. A student working at employer A while employer B sponsors the H-1B is allowed, though the arrangement is unusual and the employment must be in the student's field.
Leaving the sponsor
If the student leaves the sponsoring employer and the employer withdraws the petition, cap-gap ends on the withdrawal. The student has a 60-day grace period from that point. Employers do not always withdraw, and some leave a petition pending. A pending petition that the beneficiary no longer intends to work under is still pending in USCIS's eyes. But a student who relies on silence is taking a risk, and the sponsor owes the student nothing on this point.
If the petition is later approved for an employer the student is not working for, the student can begin H-1B status in October only by working for the sponsor. A student who does not intend to join the sponsor should consider ending the petition and replanning.
STEM OPT students
A student on STEM OPT cap-gap has a stricter set of rules for any new job: the new employer needs E-Verify, an I-983 and a paid position of at least 20 hours, and the student reports the change to the DSO within 10 days. A student between jobs is counting unemployment days, and the 150-day ceiling continues to run.
What happens to a different employer's H-1B
A new employer who wants to sponsor the student cannot join the existing petition. A new cap-subject petition would need to have been filed in the registration period. Outside it, the options are a cap-exempt employer, a different status, or waiting for the next season.
A worked case
A student on cap-gap, with an April petition filed by employer A, accepts a better offer at employer B in July. Employer A withdraws the petition in August. Cap-gap ends in August, and the student has 60 days to leave, transfer or change status. Employer B cannot file a new cap petition until the next registration.
What to do
Readers weighing a change should speak with the DSO and an immigration attorney before giving notice, because the order of events matters. Leaving first and asking afterwards is the pattern that causes harm.