It is a way of saying someone is naive - if you were born yesterday, you are a baby with no experience. Usually people say 'NOT born yesterday' to indicate they cannot be fooled.
When people say, "I wasn't born yesterday," they're indicating that they do not believe a story/excuse made by someone else. They are saying that they can see past a given story and see what is really going on.