We perform a comprehensive study of the time evolution of heavy-quarkonium states in an expanding hot QCD medium by implementing effective field theory techniques in the framework of open quantum systems. The formalism incorporates quarkonium production and its subsequent evolution in the fireball including quarkonium dissociation and recombination. We consider a fireball with a local temperature that is much smaller than the inverse size of the quarkonium and much larger than its binding energy. The calculation is performed at an accuracy that is leading order in the heavy-quark density expansion and next-to-leading order in the multipole expansion. Within this accuracy, for a smooth variation of the temperature and large times, the evolut...