The procedures for checking into Puerto Rico are clearly documented here NOONSITE
Some items worthy of note are the need for a visa if you do not have a US passport [except Canadians.] The visa waiver program does not apply to private yachts.
It is worth buying a cruising permit if you plan to change harbours/anchorages. If not you must pay everytime you do so.
US citizens on US flagged yachts can and should enroll in the local boater program.
Sailing in PR
waters is complicated by the fact that there are four districts, North, South, East, and West and you are supposed to inform the authorities when you move from one district to another.
Finally boaters who have been used to the slightly less strict approach evident in much of the rest of the Caribbean need to be aware that the US Customs and Border Protection authorities in PR
are likely to apply the rules to the letter.