F-1 students may apply for post-completion OPT up to 90 days before their program end date and up to 60 days after their program end date. The application must be properly filed with the correct USCIS Service Center. In addition, the application must be properly filed within 30 days of the date the student’s DSO recommends OPT in SEVIS.
F-1 students who completed a bachelor’s, master’s, or doctoral degree in a STEM field and are currently engaged in post-completion OPT may apply for the STEM extension if they have a job or job offer from an E-Verify employer.
http://www.greencardapply.com/question/question08/question08_0514.htm