Is there a general way to predict products of a chemical reaction, given only the atomic masses of masses of all elements involved?
Unforturnately, no.
If there's no method to do so, are we supposed to memorize all chemical reactions?
There is some amount of reactions one have to memorize individually. However, there are classes of reactions that are quite broad and have uniform rules to check if some reactions happens. Two most common of such classes are redox reactions in solutions, guarded by electrode potentials, and ionic reactions in solutions, guarded by compound solubility expressed as solubility product.
In your example
$\ce{CuFeS2 + O2 ->}$
Is an example of oxidation of sulfides. Most sulfides can be oxidized at elevated temperature by oxygen into stable oxides, in this case (if there is excess oxygen): $$\ce{CuFeS2 + O2 -> CuO + Fe2O3 + SO2}$$
$\ce{K2CrO4 + H2SO4 ->}$
$\ce{K2Cr2O7 + H2SO4 ->}$
Both reactions are ionic and guarded by relative acidity of chromic and sulfuric acids and led to formation of chromic anhydride.
The remaining reaction is unlikely to proceed at significant rate, as the oxide considered is kinetically inert. However, if it would react, the products would be potassium chromate (VI) and later ferrate (VI).