If you have a marriage visa or a retirement visa in Thailand which has already been extended to a 1 year visa then you need to have a re-entry permit when you want to leave Thailand. You need to complete an application form for this. The re-entry permit allows you to leave Thailand and return and continue the Thai visa where you had left off.
If you leave Thailand and return without a re-entry permit your 1 year visa will be invalidated and you need to start the process again from scratch. Ensure that you have applied for a single or multiple re-entry permit before you leave Thailand. The re-entry visa can be applied for at Thai Immigration in Thailand at any of their offices.
The fee for it is 1000 Baht for a single entry or 3800 Baht for multiple entry.