Relaxation of excited molecules in a medium with memory at short and long times