Primer is designed to bond with unpainted surfaces like metal or plastic while colorcoats and tricoats are not.
Primer is needed when you are painting a surface that exposes bare substrate such as metal, plastic, carbon fiber, or polycarbonate. Without primer on these types of material, your paint will not hold or last. Additionally, if your repair calls for a filler then you will need to apply primer before applying the paint.
If you are unsure whether you need it, you are better off using it. Adding primer when it is not required will not negatively affect your finish.