I have a friend who is in a STEM OPT. His OPT is ending on 15 June, 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?
(Note: I posted this same answer on travel.stackexchange.com but the question was closed there.)
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 you have all of these things including proof of a job in the US, you should be able to re-enter for the purpose of finishing the job before your OPT ends. If you don't have a job in the US, you might have a harder time explaining your 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.