The general payment term for your invoices can be defined under Settings > Accounting.
You can also define a specific payment term for each client (without overwriting the general payment term) in the client's details (People > Clients).
If you would like to use the "end of month" option when defining your payment term, you should know that the system calculates the number of days you define and then goes to the end of the month. So if you defined "60 days end of month" as your payment term, the calculation will be for example:
30/04 + 60 days = 29/06 + end of month = 30/06.
31/05 + 60 days = 30/07 + end of month = 31/07
If you don't create your invoice on the last day of the month, don't forget to always check the payment term in the details of the invoice!
Note that you can also change the due date of an invoice manually by editing the details of the invoice (Actions > Edit details in the invoice), without overwriting your general payment term or the specific payment term defined for the client.