Hammer drills, also called "rotary hammers," are rotary drills that also have a forward thrusting action. As the drill-bit spins, it rapidly vibrates front to back, allowing it to drill through tough materials such as concrete, stone, brick or tile.
High-quality modern hammer drills usually have three modes that alter their function. The "hammer" mode provides a straight impact action as in a jackhammer. The "drill" mode provides a rotary action as in a regular drill. The "hammer drill" mode provides a combination of both.
Because they have more moving parts and need to be more durable, hammer drills tend to be more expensive than regular drills. Unless you know you will be drilling through tough material, a regular drill is usually just as effective at a significantly lower cost. Another consideration in hammer drills is weight and size. Hammer drills tend to be heavier and larger than regular drills and often come with a side-mounted handle to aid in their control. If you are planning on doing delicate drilling that requires dexterity and precision, a regular drill may serve you better.
Ultimately, while a hammer drill certainly can be used as a regular drill by putting it in "drill" mode, it has some limitations and a complete tool inventory should ideally include both. However, if you're only going to buy one drill, a hammer drill is the more versatile of the two.