You shoud lubricate your firearm according to the manufacturers specifications as per the owner's manual. Some firearms require more lubrication in some areas than others do. In the absence of a manual, there is always Youtube
As a general rule most metal surfaces that contact other metal surfaces should at least have a thin coating of oil or grease, but there are some exceptions for example usually firing pins are not lubricated or if so most of it is wiped off so they don't attract dirt and get sticky. All metal surfaces even the exterior need to be at least oiled and wiped down occasionally for corrosion resistance.
Oil and cleaning agents need to kept away from ammo. The penetrating properties can seep into the ammo and contaminate the gunpowder. You don't want that.