? more info needed
First, why were you prescribed penicillin
in the first place?
Any medication could potentially cause stomach side effects, but it could either be the medication or the underlying condition.
If it persists, talk to the doctor who prescribed it, and if it was a dentist for a tooth infection, speak to your doctor about changing it to something else, or ask dentist if it is absolutely necessary.