How much gold and elixir can be stolen when raiding other players?

Solution 1:

Until you reach Town Hall 5, 20% from your gold/elixir can be stolen from the storages. The cap for this is 200k. From TH6 and onwards, this percentage drops by 2% for each TH level. From TH7 and above the cap increases with 50k for each TH level.

So for clarity and completeness (and no calculations):

TH Level    % Available to be Stolen    Cap    Storage Amount to Reach Cap
1-5         20%                         200k   1.000M
6           18%                         200k   1.1111M
7           16%                         250k   1.5625M
8           14%                         300k   2.1428M
9           12%                         350k   2.9167M
10          10%                         400k   4.0000M

Solution 2:

Source is here TH Level G/E Storages1 G/E Collectors1 DE Storage2 DE Collectors2 CC3 TH 1 - 5 20%, 200K cap 50% None None 10% TH6 18%, 200K cap 50% None None 9% TH7 16%, 250K cap 50% 6%, 2K cap None 8% TH8 14%, 300K cap 50% 6%, 2K cap 75% 7% TH9 12%, 350K cap 50% 5%, 2.5K cap 75% 6% TH10 10%, 400K cap 50% 4%, 3K cap 75% 5% 1G/E is Gold/Elixir
2DE is Dark Elixir
3CC is Clan Castle
-[NOTES]-
1. [I use the term "Collector" loosely, it means collector, mine, and drill to their respective resource]
2. [Collector loot is only capped by how much the collector can hold]