The green parts may contain solanine, so cut them off.
When potatoes are exposed to light, they make chlorophyll, which turns the skin green. The green itself is harmless, but it's a warning sign: the same conditions cause potatoes to produce more solanine, a natural bitter compound that protects the plant from insects and disease. Solanine also builds up in sprouts and the "eyes."
In large amounts, solanine can cause nausea, stomach cramps, headaches and other symptoms. Serious poisoning is rare because it would take eating a lot of very green potatoes, and they taste noticeably bitter.
Food safety agencies advise cutting away all green areas and sprouts generously before cooking. If a potato is green throughout or tastes bitter, throw it away. Cooking doesn't reliably destroy solanine.
To prevent greening, store potatoes in a cool, dark, dry place, in a paper bag or basket rather than a clear plastic bag, and away from bright kitchen light.