You can add tips/gratuity by going to Settings > Application > scroll down to the Invoice Options > then there is a line item that needs to be toggled on -
Allow customers to Tip on Invoice Payments: Toggle on yes.
Click Update at the bottom to save.
If this setting is enabled, when your clients go to make a payment for their invoices they can also include a tip! This will update the payment's total, and add an Invoice line item listing the tip's amount so that the invoice doesn't show a negative remaining balance!