The Clash of Clans Community ultimate guide to... Shields
Shields protect you from enemy attacks. You can purchase Shields by using Gems in the Shop, where you'll find 3 options: One Day Shield, Two Day Shield, One Week Shield.
You can purchase up to 3 Shields simultaneously for a maximum coverage of 10 days. Note that each Shield has a Cooldown period (equivalent to 5 times the duration of the Shield), during which time you're not able to purchase and activate a new Shield.
There are also automatic Shields. These come into effect when your village is raided and their duration is dependent on the amount of destruction caused: 40% destruction activates a 12-hour Shield, while 90% destruction triggers a 16-hour Shield.
Note that attacking another player's village while your Shield is still active will disable it - so consider whether it’s worth it. It's worth noting, though, that this affects multiplayer attacks only.