A mutation can affect a whole organism if that mutation happens in a sex cell - an egg or a sperm - which is then fertilised and becomes an entire organism. This is known as a germline mutation.
Alternatively, a somatic (that is, not in a sex cell; literally ''bodily'' ) mutation can affect a whole organism because all of that cell's offspring will also carry the mutation - this is how cancer happens. In that case not all of the organism's cells carry the mutation and the mutation is not heritable, but can obviously still affect the organism.