We have done this many times on our return flight thru San Juan. We usually arrive on Air Sunshine. You first go thru Immigration, then go downstairs to claim your bags, then go thru Customs. After that you exit the secure area and check your bags at your airline. Then you go thru TSA check and to your departing gate. I would allow at least 1 1/2 hours to get this all done comfortably after your arrival in San Juan.