Yes. Calories count, even on a ketogenic diet. So if your caloric-intake is above your caloric-expenditure (meaning you eat more than your body needs) then you will gain weight. That said, because the keto diet is so satiating it is unlikely you will overeat as you will have a significantly reduced appetite.
If you WANT to gain weight, as lean muscle mass, then use the Keto Calculator to work out how much to eat. If you want to lose weight, but are in fact maintaining or gaining then something is wrong with your macros or food choices. Carb creep (eating more carbs than you think you are) could be the culprit. Monitoring and tracking your food and checking your macros will keep you on track with your keto goals whether it is weight gain or weight loss. If you want to gain FAT (not muscle) then keto is not the right diet for you as metabolically your body will be burning and using fat not storing it.