With an F-1 visa, you can stay in the US as long as you remain student status, which means you are supposed to leave US within 3 months after your graduation, the expiration of your student status.
However, an OPT, if any, may extend your legal stay in the states to an extra year.