Current visa rules make it very easy to stay. STEM graduate students on an F-1 visa get a whopping 36 months of employment authorization in the US. Look up OPT extension. That's 3 years they can apply to get a H-1B.
In fact, getting a M.S. from a mediocre U.S. school is a popular method young people use to immigrate.