Puerto Rico is officially an unincorporated territory of the United States. For all due purpose, that mean that it's a part of the US at the federal government level, in much the same way that any other US state is.
As a result, all immigration/visa/etc rules are exactly the same as if you were entering any other US state. All immigration is handled by the US Customs and Immigration services (USCIS) just as at any other US airport, and the requirements to enter PR are the same as any other US state.
If you arrive in PR from an international (ie, non-US) location then your arrival will be treated like any other international arrival into the US - you will require either a US visa, or if you are able to enter under the Visa Waiver Program then you will need an approved ESTA.
If you enter from a "domestic" (ie, US) location then just like any other domestic airport in the US there is no immigration formalities.
In my experience, the only difference between Puero Rico and any other US airport is that the TSA appear to carry out more frequent checks of ID when you are actually boarding the plane - they do this occasionally at all US airports, but I've had them do this on every flight I've had out of PR.