You need to consider different factors before deciding to refinance your mortgage. One of these factors is the purpose of the refinance.
If you are refinancing to lower your mortgage rate, the best time is in a lower-rate environment. You also have to ensure that the gain from the lower rate will be more than the costs incurred, like closing fees, appraisal fees and prepayment penalties.
On the other hand, if you are refinancing to consolidate your debt and manage your monthly payments or cash out on equity, you should consider refinancing in a higher property value environment. That is, you want the maximum market value for your property and the money needed to help you accomplish the reason for the refinance.