Dietary fat directly becomes body fat. To lose weight or stay lean, you should eat a low-fat diet.
Weight gain results from caloric excess regardless of macronutrient source. Fat is actually essential for hormone production, nutrient absorption, and brain function. Low-fat diets are not superior for weight loss compared to other approaches. Some dietary fat (especially unsaturated fat) is beneficial for health. The old 'fat is bad' dogma has been replaced by more nuanced understanding.