One of English's more colorful idioms, "when pigs fly" describes an extremely unlikely event, one that will never realistically come to pass.
Pigs would only fly (legitimately) if they sprouted angel-like wings and began flying on their own power. This is a ridiculous idea, and is used to ridicule another idea.
Example: "Think you might wind up marrying Ray someday?" "Me? Marry that fat, lazy slob Ray? When pigs fly!!" In this case, the speaker is strongly denying that there is even a remote possibility of marrying "Ray."