Is the patch or pills better for quitting smoking?

Person dependent. I love helping people stop smoking! there is no single effective plan for everyone though. First we need to talk about your habits, what you've tried before, mood/ behavior tendencies, how much nicotine you use, etc. Etc. Most of the time a combination of techniques is best!
Neither is better. The success rates of both patches or gum (there are no nicotine pills - just gum, lozenges, inhalers) are similar, and often it is personal preference. I generally prescribe a patch because it is easier, and then lozenges to use if craving breaks through. If by pills you mean zyban (bupropion) (wellbutrin) and chantix, they have higher quit rates, when combined with counseling, than nicotine replacement.