It's a joke, a rather bitter joke. "Time is a great teacher" is a saying or proverb. It suggests that the best way to learn things is slowly and naturally, through life experience over time. Your sentence makes a joke by taking that saying and adding an ironic twist to it. It means that life is short, so we don't have the luxury of learning things slowly.