Calling someone a pig means they are not sharing or are being selfish. It is a negative term.
He is such a pig about money.
Don't be a pig when sharing food.
To pig means to eat in a messy way, usually more than usual. It's often used humorously.
She pigs out on chocolate.
He always pigs at the buffet.
This usage is a slang term and is often used in a disrespectful manner toward police officers.
He called the officer a pig.
Don't be rude to the pigs.