Those are commonly called floaters.
Usually what you’re seeing is particles of things in your tears (like dead cells) or bits of a gel-like substance that your eye produces to protect it (sometimes this stuff clumps up a little and looks like floaters).
These can show up at any random time, but they’re more likely to when you’re crying, your eye is irritated, or you stare at something bright for a while.
If you think it’s entertaining to see those, here’s another really weird thing that can happen: sometimes if you look at the sky (not the sun) on a bright day, you can actually see the blood cells moving around in your eye; this looks similar to “snowy” TV screens (if you don’t know what I mean, it’s what it looks like when the cable is messed up or you go to a channel you don’t have).