They are stressed
Being stressed or going through a stressful phase can be manifested through nail-biting or chewing on the end of pens, which is relieving for some people. (See Why do type A personalities get stressed?)
It helps them concentrate
Some people find chewing on pens to help them concentrate when they’re studying or sitting for an exam.
They are nervous
When a person is nervous during an exam, they might chew on their pens to relieve this tension. (See The Body Language of Anxiety)
It relieves pain
Some people chew on their pens to relieve headaches or jaw pain from temporomandibular joint disorder (TMD).
Some people resort to bad habits when they’re bored such as biting their fingernails or chewing on their pens.
They’re trying to quit a bad habit
Some people start chewing on pens when they’re trying to quit a bad habit such as smoking. In this case, chewing on a pen is a distraction from craving cigarettes.
They zone out
Some people chew on their pen when they zone out and stop focusing on a certain thing. In this case, the chewing is done unconsciously.