Payments are automatically matched back to appointments. Occasionally, if a whole invoice is not showing as paid you may need to run the matching process. To do this head to Reports then ACC Appointments Not Paid.
Navigate to the dates you are interested in and then click "Check Payments" in the right side bar:
If only one appointment of an invoice is not showing as paid, clicking the green plus button to the left of an appointment may show the reason for non-payment.
Other times a payment may not be able to be matched back to an appointment if something in the appointment has changed since invoicing, if that is the case, check the Report > Payments not matched to appointments.