Garlic is very potent and the smell can linger on your hands for hours, even after washing.  Three easy remedies:

You can avoid the problem by wearing disposable gloves.

An easy trick to remove the smell is to rub your hands with a stainless steel spoon or other stainless utensil under running tap water. You can also rub your hands on the inside of your stainless steel sink. (Not my preferred method since most sinks are really not that sanitary.)

Rub your hands with a little salt or baking soda. I have also heard that toothpaste works.