Its just using common sense.
Is it a large picture with a lot of detail? Use jpg.
Is it a fairly small picture - ie an anime screen cap? Use jpg. Why? most anime these days are encoded in a lossless format, why would you bother saving a lossy picture in its full glory and use 500kb when it could be done with 95% the same quality but in about 50kb?
Is the picture full of open plain and simple colours? Like maybe a vector? Use png then.