My wife's spouse visa expires on July 27th 2016. When should we apply for F.L.R?

Thanks in advance.