Pierna vs. pata

The Spanish words 'pierna' and 'pata' have a common theme in that they both refer to the concept of 'leg'. However, they have different connotations and usages in the Spanish language, often related to the subject to which they are applied.

Pierna

'Pierna' is a word used primarily to describe the human leg. It refers to the entire limb from the hip to the foot.
Ella se lastimó la pierna jugando fútbol.
(She injured her leg playing soccer.)
Después de correr un maratón, me duelen las piernas.
(After running a marathon, my legs hurt.)

Pata

In contrast, 'pata' is used to refer to an animal's leg or to furniture legs. In colloquial speech, it can also refer to a person's legs in a less formal or crude way.
El gato se escondió y sólo se le veían las patas.
(The cat hid and only its paws could be seen.)
La mesa se tambalea porque una de las patas está rota.
(The table wobbles because one of its legs is broken.)
¡Vaya, tienes las patas largas! ¿Juegas al baloncesto?
(Wow, you have long legs! Do you play basketball?)

Summary

In summary, 'pierna' generally refers to a human leg and has a respectful and anatomical context. 'Pata', on the other hand, is usually used to refer to the legs of animals or inanimate objects such as furniture, but can also be used in informal speech to refer to human legs in a less polite way.