My book, on general integration, builds a lot of theory around e.g. the Fubini-Tonelli theorem and when it can/can't be applied, but does not do the same for integration by parts. Perhaps it's just always allowed, but it does not say that explicitly either. In particular, when evaluating "real integrals", my professor and others on the internet seem to just use it without justification.
So my question is: What are the necessary and sufficient conditions for using integration by parts? Searching the internet does not particularly help, because the wording of the question is similar to that of "when is it helpful to integrate by parts", as opposed to "when am I allowed to integrate by parts".