As you may know, Social Security Retirement and Disability benefits are paid 1 month in arrears.
Social Security is unable to pay benefits for the month of death, no matter what date that occurs.
So, in your situation, the payment received in August was for July and that payment does not have to be returned. However, the payment for August will come in September and will have to be returned since your wife passed away on August 31st, the payment for August (paid in September) will have to be returned.
Here's how the SSA puts it in one of their publications:
"If a beneficiary dies,
Let us know if a person receiving Social Security benefits dies. We can’t pay benefits for the month of death. That means if the person died in July, the check received in August (which is payment for July) must be returned.
If the payment is by direct deposit, notify the financial institution as soon as possible so it can return any payments received after death."
Let me know if you have any follow-up questions.
Please remember to rate my response.
Thanks very much,