We derive equations of motion for the reduced density matrix of a heavy quarkonium in contact with a quark-gluon plasma in thermal equilibrium. These equations allow in particular a proper treatment of the regime when the temperature of the plasma is comparable to the binding energy of the quarkonium. These equations are used to study how the quarkonium approaches equilibrium with the plasma, and we discuss the corresponding entropy increase, or free energy decrease, depending on the temperature regime. The effect of collisions can be accounted for by the generalization of the imaginary potential introduced in previous studies, and from which collision rates are derived. An important outcome of the present analysis is that this imaginary potential has a sizeable dependence on the energy of the relevant transitions.