As always there are flight guidelines for each ship and port. You cannot even add transfers if you don't stay within those guidelines. Typically the guidelines are around 4 hours before the ships departure time (remember you have to be in the check-in line a minimum of one hour before). That leave a 3 hour window from flight arrival to when you have to be at the pier. In my opinion even these guidelines are way too tight. Flight delays and changes are all too common today. My last cruise out of San Juan I gave myself 5+ hours. They changed my flight two weeks before the cruise and moved it up an hour and a half. I checked on other flights and the ones available were either horrible times or unavailable. Then we had a delay on the runway which fortunately was resolved in about 15 mins.
If you can, fly in the day before your cruise and get a hotel. You'll be rested and enjoy your cruise more. If not give yourself at least 5 hours. The saved worry and aggrevation is normally worth the cost difference and inconvenience of getting up a little earlier.