Pharmacy is a professional field and area of study, while pharmacology is a more specific science that is studied either in its own right or as a part of pharmacy or other fields like medicine.
Essentially, pharmacology is the science pertaining to the effects of drugs on the body. In studying it, you learn about such things as receptors and how drugs interact with them, the biochemical functioning of various bodily systems in both normal and disease states and how drugs can affect them, etc.
On the other hand, pharmacy is basically the field that pertains to being a pharmacist. It typically involves the study of sciences like pharmacology, pharmaceutics and pharmacokinetics, as well as more profession-based elements like counseling patients, how to treat minor ailments, checking and filling prescriptions, the manufacturing process of drugs, etc.