When you have the war gold and elixir storage in your clan castle, what happens when you collect it?
When you collect your war win bonus from your clan castle, it goes directly into your storage.
Do you only collect the war and elixir you from which you have won from the war?
No. War win bonuses can be accumulated over several wars, however: If you run out of space in your clan castle, any excess resource will be thrown away.
That's why it is recommended to claim your resources right after getting them (if your win always gives you close to your clan castle's capacity.
I don't want to make a mistake and take all the resources if we share it as a clan.
Don't worry - War win bonuses are awarded on a per player basis. For example, a high-up player defeating other people with Town Hall (let's say 8) will recieve more war loot bonus than those defeating Town Hall 6 players. You can't steal another player's War Win bonus (if they have some unclaimed) unless you looted it from a multiplayer battle.
Your war loot bonus is determined by the matches that you win, regardless if you only scored one star. As long as it's a defeat (scoring more than 1 star), you'll receive the loot bonus for the village you've won it from.
Lastly, even if 10 players defeat the same village, they'll all recieve the war win bonus for that village (if they win the war, otherwise - the standard 40%). War win bonus works like your league bonus, except you only get to claim the win bonus AFTER the war has been done. All loot from previous wars will be avaliable for collection (even when in another war)