Within reason, you can cancel your car insurance policy at any time. In reality, this means that you can notify your insurance company you wish to terminate the policy at the beginning of the next billing cycle. If you do not give the insurance company sufficient notice, you will be charged for another billing period while you wait on the cancellation notice to be processed.
If you own a vehicle, it is not a good idea to cancel your existing policy until you have a new one set up to go into effect. Driving without proof of insurance is a crime in most states, and could result in additional charges when you get another insurance policy, the suspension of your driver license or the revocation of your vehicle registration and license plates. In short, getting caught driving without insurance is far more expensive than simply having to get an insurance policy when it happens.
Pick the day you want to cancel the policy carefully, making sure that your new policy is already effective and that you give the insurance company at least 2 weeks of notification to close out the automated billing process. It might delay getting away from a troubling insurance agent by a few days, but it will also prevent you from getting hundreds of dollars in additional costs when you have an accident without any insurance to protect you.