Formula limits
The main limitation on formulas, that is, the first limit you encounter when you'll be building complex formulas, is the number of characters a formula can contain which, as of Summer '20, is set to 3,900 characters including spaces, line breaks, and comments.
Tip
If you need more formula space, create a separate formula field and chain it in another formula.
Another important limit is that a formula can only show a maximum of 13,000 characters (so you are not allowed to output bigger text content).
When a formula is saved, it is converted into a compiled format, which must not exceed 4,000 bytes and when it is actually compiled (by adding any other related formula), it cannot exceed 5,000 bytes: there is no direct correlation between the formula size and its saved or compiled size in bytes.
Moreover, remember that you cannot reference more than 15 objects in cross-object formulas for a given object, that is, you cannot link more than 15 object...