We investigate the dynamics of optical matter creation and annihilation in a colloidal liquid that was employed to construct an all-optical switch. It is revealed that the switching-on process can be characterized by the Fermi-Dirac distribution function, while the switching-off process can be described by a steady state followed by a single exponential decay. The phase transition times exhibit a strong dependence on trapping power. With an increasing trapping power, while the switching-on time decreases rapidly, the switch-off time increases significantly, indicating the effects of optical binding and van der Waals force on the lifetime of the optical matter.