It is the VISA type that determines what tax is exempted from withholding. If an employer mistakenly withholds the FICA tax from an J1 or F1 OPT the student is instructed to request the withholding back from the Employer.
International Student F1 J1 OPT Tax Exemption - International Students are exempt from Social Security and Medicare taxes for a period of Five years, as long as they are a full time student. They still have to pay Federal and State Income Taxes. International Students can file IRS Form 843 and Form 8316 to Claim Social Security and Medicare Tax refund, withheld in error, on wages of a Non Resident Employee in F1, J1 visas or Optional Practical Training Taxes - OPT F1 J1 Tax Refund or F1 J1 Tax back.
All the above said, if the F1 OPT VISA holder becomes a Resident Alien then the rules would change regarding the FICA withholding.
Resident aliens, in general, have the same liability for Social Security/Medicare Taxes that U.S. Citizens have.
If you are a student temporarily in the United States on an F, J, M or Q visa, and you have been present in the United States during no more than five calendar years, you are an exempt individual. For example, let's say you entered the U. S. on June 4, 2004 as a student on an F visa, and have remained here until 2009. You are a nonresident alien for 2004, 2005, 2006, 2007 and 2008. If you are in the U.S. for at least 183 days in 2009, you will be a resident for tax purposes in 2009.
If the individual has not met the time frame as described above, they will need to file a tax return as a resident alien instead of the NR1040 form that is filed by NonResident Aliens. This would also change the withholding for taxes.
If the student advises that they are a NonResident Alien then you are not to withhold the FICA.