There are actually three different kinds of tears. Ones that are always there, reflex tears (like when we get dirt in our eye or are poked), and emotional tears. It's actually been found that tears get rid of hormones in order to reduce our level of stress.
But why, exactly, do we cry? According to William H. Frey, people feel better after crying. Which I guess makes sense, because we cry when we're frustrated or sad or in pain. It's possible that crying gets rid of all the bad feelings through tears. Tears can also be a sign to others that we are in pain or upset, especially before language is developed. It's essentially a form of communication.

