My teacher says that mechanical energy is conserved whenever forces are conservative but shouldn't 'forces' be replaced by 'internal forces of the system'. I am quite confused about when to apply mechanical energy conservation.
I can see your confusion and actually agree with both of you. One of the things that can make things like this confusing is learning the art of choosing "the system". You are free to analyze the same problem using different systems.
Let's consider a typical projectile problem. If we consider the system to be just the projectile, then there are no internal forces and gravity is an external force. In this case, since gravity is a conservative external force it can be associated with a potential energy. Then the mechanical energy is conserved as the sum of the potential energy due to the external force and the kinetic energy of the projectile. In this scenario your teacher's statement would be correct.
Now, let's consider the projectile + the earth to be the system. In this case gravity is an internal force. It is still associated with a potential energy since it is still conservative, but now this potential energy is internal to the system. The mechanical energy is still conserved as the sum of the potential energy due to the internal force and the kinetic energy of the projectile. In this scenario your statement would be correct.
The important thing to notice is that the two scenarios are the same physical scenario and the conservation equations are also the same. All that changed was the definition of "the system" and the resulting designation of certain quantities as "internal" or "external". Either way the physics and the calculations should be the same, regardless of if you take your approach or your teacher's. Choosing the appropriate designation is something of an art that you will learn simply by doing problems.