Spore has a built-in console: hold Control and Shift, then press C to open it. Typing a code and pressing Enter activates it.
Using cheats disables achievements for that save, and later stages will not unlock through play unless you have already reached them. That is why the common advice is to complete all five stages first, then cheat freely in the sandbox you have earned.
Useful entries include adddna for extra DNA, moremoney for cash, and refillmotives to restore your spaceship's stats.
For a fuller list, dedicated code sites such as Cheat Code Central maintain comprehensive references for each stage.