Memory Effects In Brownian Motion, Random Walks Under Confining Potentials, And Relaxation Of Quantum Systems