Nickers had some great advice. I actually had to call the vet yesterday for my mare's eye, who wears a fly mask 24/7 except in her stall where she has a fan. She's been getting a little gungy and swollen in both eyes about once every week or 2 because of the heat and flies. I've just been using a cool damp towel and it's cleared up in a few hours. However yesterday when I went out to feed in the afternoon, she was so gungy it had dripped all the way down her face to her nostrils, and she was blinking rapidly. She had a lot of gunk in her eye and it looked like she'd been rubbing it. When the vet arrived she said this has been a very common problem this year because the mild winter didn't kill the flies. She took one look and said it was good we had called because a lot of horses have been getting ulcers on their eyes because of bacteria carried by flies, and that my mare didn't have any but would have developed one soon after. She flushed it out and gave us antibacterial ointment to put in for the next few days, and then as needed if it comes back. By later last night it was almost entirely cleared up. The vet also said that she recommends NOT using a fly mask (which she said is normally the opposite of what she suggests) because the heat is so bad they sweat too much and it's actually causing more harm than good. So if it's hot and humid where you live, you might want to try that.
If they are just a little swollen and gunky, I wouldn't worry too much and just keep using a damp towel to help clear it up. If there's a lot of drainage though and not quite as much swelling, I'd definitely call the vet to make sure there isn't an ulcer/infection as it can cause vision problems and is pretty serious.