File Form I-539. See: http://www.uscis.gov/portal/site/uscis/menuitem.5af9bb95919f35e66f614176543f6d1a/?vgnextoid=94d12c1a6855d010VgnVCM10000048f3d6a1RCRD
You can send out your application just about 10 days to 14 days before your OPT expires or earlier.