How long does the 500,000 baht need to sit in my account for the DTV?

The required THB 500,000 should be held in your bank account for at least three months before applying for the DTV. If you later apply for the one permitted 180-day extension, you should also expect to show that the funds have been maintained for the three months before the extension application.

What We See In Practice

I have the THB 500,000 now. Can I transfer it into my account just before I apply?

No. The issue is not whether you have the money on the day you apply, but whether you can show it has been in your account for the required period. This is one of the most common reasons applicants are asked for additional information or experience delays.
Although the DTV financial requirement is THB 500,000, applicants are normally expected to prove they have held those funds over time rather than deposited them immediately before applying. In practice, Thai embassies and consulates commonly ask for bank statements covering the previous three months.
The same approach generally applies if you later apply for the one permitted 180-day extension. Immigration will usually expect to see that the THB 500,000 has again been maintained in your account for the three months leading up to the extension application. If you think you may want to extend your stay, it is worth planning ahead so you continue to meet the financial requirement when the time comes.