Can forgetting labor pain be an evolutionary advantage as animals don't know how to avoid labor? I've often heard the claim that women are forgetting, or remembering labour and birth pain as being less severe. Some people say that this mechanism has an evolutionary advantage, as if it didn't exist women would avoid having more babies...

Is this explanation possible? I'm assuming most animals don't know the relation between contraception and labor, so they won't be able to avoid labor even if they wanted...

How long have humans been aware of this relation, and is it possible that evolution has been able to work in that time-span?
I agree.  The connection between having sex and the pain of labor is so distant, it seems unlikely that it could be selected against.  In theory though, there could be enough time in human history for it to have happened, especially early on when child mortality was much higher than now.  If every mother who remembered extreme pain in labor never gave birth again, and a large proportion of those babies died, the attribute could disappear within a generation or two.

However, there is evidence that mothers don't always forget the pain of labor.  Even if they do forget to some extent, I'm not sure how that compares to other kinds of pain.  For example, marathon runners forget the pain of their last race.

Some advantages of remembering the pain of labor could be preparation for subsequent births and arranging support in advance.