You can apply up to the day your permit expires. As long as you apply for the BOWP before your permit expires, you can continue working in Canada as per the conditions of your IEC (on implied status until you receive an answer on your BOWP.
As per above, you can start gathering your documents...