Two differences matter most.
First, taxonomy: porcupines are rodents, while hedgehogs belong to a completely different family and aren't rodents at all.
Second, their quills behave differently. A porcupine's quills detach from the animal when they lodge in something, which is part of how they defend themselves. Hedgehog spines stay firmly attached and don't pull free.