To link a completed payment to an existing invoice, go to the Payments menu and click on the desired payment to expand.
At the very bottom right corner, click Link to a Different Invoice. From here, you can search keywords for the invoice you wish to link the payment to. This is especially useful if you have created an invoice to be paid at a later date, or if you are receiving partial payments for an invoice. Once the payment is linked, the invoice will be marked as paid, or partial.