You have the option of canceling your renters insurance whenever you want. It is not recommended to leave yourself without any coverage at all, but the terms of the contract allow you to cancel it in writing at your own discretion. The best solution is to shop for a replacement renter's insurance plan before you cancel the current one, and you can start doing the research for that here on this website.
The reason to start on a website that offers a selection of insurance companies is that a brokerage is dedicated to the customer rather than being exclusively to the company. In effect, an insurance brokerage website works for you, not the insurance company, and they will put more effort into finding the best deal for your individual needs. You can get a free online quote for renters insurance here, as well as seeing how that quote compares to other leading insurance providers.
You are required to give your insurance company at least one billing period notice-- usually around 30 days-- of your intent to cancel. Most companies prefer the notice to be provided in writing, but email is acceptable to most. Once you have given the insurance company the required written notice, you can go ahead and select the insurer you want to replace them.
Just as you can set a specific date to cancel your existing policy, you can also set a start date for the new policy. It is usually a good idea to give yourself a few days of overlap in case of a problem with the new coverage, but as long as you do not have an extended gap in your coverage, you can switch whenever you are ready to do so.