Relaxation time for the alignment between the spin of a finite-mass quark or antiquark and the thermal vorticity in relativistic heavy-ion collisions