I have a friend who is doing a Science-Technology-Engineering-Mathematics (STEM) optional practical training (OPT). His OPT is ending on 15 June, 2018. His visa is valid till December 2018. He is travelling outside the USA on 21 April, 2018 and coming back on 15 May, 2018. Will there be any issue at immigration while he comes back to the USA, since he is just left with one month of his OPT?
Here is an F-1 travel FAQ from Homeland Security which mentions:
If USCIS has approved your OPT you will be expected to have your EAD in hand to re-enter the United States, in addition to your Form I-20, valid passport and visa, and a letter of employment if you have one. If you exceed the limits on unemployment while outside the United States, you will not be eligible to re-enter the United States in F-1 status.
If he has all of these things including proof of a job in the US, he should be able to re-enter for the purpose of finishing his job before his OPT ends. If he doesn't have a job in the US, he might have a harder time explaining his purpose of entry.
Before traveling during OPT, it's always a good idea to check with your Designated School Official to make sure your I-20, SEVIS record, OPT reporting and STEM OPT reporting requirements are all in order.