I think that porco is more volgar than maiale. Porco is often used as an insult, like in "Sei un porco!", or as an imprecation ("Porca puttana" means "Pig whore"). Personally I think that a sentence like "Ho mangiato del porco" would be more unusual than "Ho mangiato del maiale". To put it bluntly, porco is more volgar, when you are talking to a friend you can say porco instead of maiale; maiale is more formal and it is commonly used to indicate the animal (in animal books you will always find the pig as "maiale", no as "porco").