Why do my teeth hurt when I chew gum? Does that mean I have weak teeth or cavities?

Depends. It depends on where the pain is, when it happens, how long it lasts and can anything else make the pain happen. It could be a muscle problem related to your bite, it could be a fractured tooth, it could be a cavity. Without a thorough exam nobody can tell. Make an appointment to get it checked out before something more involved happens.
See your Dentist. Pain with chewing whether it be from gum or food in general could be a varying range of possibilities and seeing your dentist for an exam will determine the reason to your discomfort.
Possible cavity. The sugar in gum, or candy, will cause the tooth to hurt. Sometimes a filling is defective and needs to be replaced. See your dentist for an evaluatin to find out if you have cavities. The sooner you have them treated the better.