When a card with a lightning symbol is chosen it is discarded immediately. Person cards are discarded when you use their ability. Building cards must be discarded if you pick one you already own. Building or person cards must be discarded if you would have more than 5 total cards at the end of a turn. You can not discard the cards with the flag icon.
This is all changed if you are the one card that gets rid of your card limit.