It means it will never happen... or, specifically, it WILL happen when pigs fly. :)
You can use "when pigs fly!" as a retort to mean "Huh! That'll never happen!" We have many colourful expressions to express impossibility.
Another example: "I'll agree to that when pigs fly" = I will never agree to that.
From the net:
"Taxpayers should pay for the new Falcons' stadium when pigs fly..."
"It is something that will be approved when pigs fly. What is the point of putting it on the ballot in Montana? A waste of time and effort."
"We need to reassess the system. Aye, when pigs fly."