This question already has an answer here:
Assuming that quantum computers are implemented some time in the near-ish future, how vulnerable is Bitcoin to decryption via quantum algorithms? For example, Shor's algorithm enables a quantum computer to prime factorize in polynomial time. A variant of it can crack ECDSA.
However, Bitcoin relies on a scripting system, so if quantum computers are created, one probably can just switch to a secure script1
Is Bitcoin vulnerable to attacks from quantum computers? Are these vulnerabilities fixable2?
1. Then again, there are limits to scripting and quantum computing may make it impossible for any script to work.
2. "Fixable" can both be client-side fixable, where everyone just tweaks the script they use and transfers all their money to a clean set of addresses (thus securing all their bitcoins with the new script), or protocol-side fixable, where the protocol is tweaked and everyone downloads a new client. The latter is nor preferable, since the old bitcoins will probably be lost in the process.