In an on premise environment, there are guidelines around working with attachments in InfoPath and farm admin would be able to change the attachment size limit in the machine.config / web.config. However, the idea is to keep minimal attachments within the form, and make sure the InfoPath file size as a whole is within the file size limit as configured in your farm.
In SharePoint Online, there is a hard limit on the total attachment size to the InfoPath forms you create and store in Forms Library:
Below is an illustration of the error message you would get if you upload a file larger than 5 MB, or the total number of files attached is over 5 MB:
However, this limitation does not apply to Custom List with customised forms using InfoPath. What I mean by that is, in the ribbon you would see Customize Form where you can change you New/Edit/Display form be presented using InfoPath.
When I Create/Edit, I would see a fully branded page with an InfoPath Reader web part – I would be able attach files over 5MB. This means the attachments are not being saved as part of the InfoPath form as it would in a Form Library.
It is important to note that there are features of InfoPath not available to the customised forms in a custom list. Such as:
- No repeating tables/sections
- Rules – Form Onload rule
Thus, you should incorporate the above factors when you design your solution.
On another note, Microsoft has announced InfoPath will be retired and InfoPath 2013 is the last release as a product. However, it is supported until 2023. Here is the full detail –> Update on InfoPath and SharePoint Forms