Yes styes can be caused by stress as well as sleep deprivation and poor dieting habits.
Although styes are most commonly caused by a bacterial infection of the eye.
A stye will normally go away on it's own within 2 days but you can help get rid of the stye by applying a warm compress over the eyes.