As a general rule, an F-1 student on OPT can apply for a green card. There are backlogs in all green card categories right now and this is really what determines the length of the process. So, assuming the backlogs don't change in any significant way, those in the highest category (EB1) from countries other than India or China could get their green card within 2 years but those in a lower category (EB2 or EB3) or from India or China should expect the process to take longer than 2 years.