But the duration of legal residence under OPT is shorter than it is under H-1B: Participants may work in the U.S. for 12 months after graduation, extendable to a maximum of 36 months for those with a degree in a science, technology, engineering or math (STEM) field.