It has to do with your age at the date of the exam. So in the case you mentioned, if you have the exam when you're 39, you're good to go for 36 more months (you'll be 42 when you next need an exam). As per Part 61.23:
(ii) On or after September 16, 1996, expires at the end of:
(A) The 36th month after the month of the date of the examination shown on the certificate if the person has not reached his or her 40th birthday on or before the date of examination; or
(B) The 24th month after the month of the date of the examination shown on the certificate if the person has reached his or her 40th birthday on or before the date of the examination.
)_( Dan
RV-7 N714D (715 hours)
http://www.rvproject.com