@Ronnie *****
, what is your nationality exactly?
Basically, your understanding is right.
If you are not from one of 9 countries that are prohibited from tourism extension, you can apply for 30 days extension when you re-enter Thailand for the last 15 days, which makes it up to 45 days.