You should disconnect your rain barrel before the first hard freeze. If you empty all water out of your barrel, you can keep it attached for a few additional weeks; just make sure you are completely emptying it every time it fills.
We recommend washing the barrel when disconnecting it for the season. Use an environmentally friendly solution of 2 tsp. of castile soap + 2 tsp. vinegar or lemon juice per gallon of water for cleaning, swishing the solution around inside the barrel then rinsing the inside of the barrel with a garden hose. A concentrated spray nozzle will work well to remove residue from the inside of the barrel.
You should wait until the first good rain of the springtime has fallen before reattaching your rain barrel. The first good rain should flush considerably more debris from the roof and gutters than subsequent rains. Attaching your rain barrel before this point may increase the chances of clogging the diverter.