1

Open the invoice and scroll to Payments. It shows what is still outstanding.

The Payments panel on an invoice, showing the full amount still outstanding
2

Choose Paid in full or Part payment, then the amount, the date, and how it was paid.

The payment form filled in with a part payment
3

Press Record payment. The invoice now shows what has been received and what is still owed, and you can record another payment the same way.

The invoice after the payment is recorded, showing what was received and what is still outstanding

A deposit taken before the invoice even existed, or money that lands weeks later, both go in the same way.