For subcategories or grade items within a parent category (including the overall gradebook category) set to use Natural or Weighted mean of grades for aggregation, you will be able to set their weights, or individual contribution to the parent category total. To do so, go to the Gradebook setup page/tab. By default, Weighted mean of grades will show a 1 in each weight field, and Natural categories will show a calculation for each item or subcategory in it derived by dividing the points for that grade item (or total for that category) divided by the total possible points in the parent category. To modify these amounts, click on the check mark to the left of the weight field. Once this check box is marked, you will be able to enter a custom value for the weight of that category or grade item.
For Weighted mean of grades, this number will represent how many times it will be counted in the parent category (e.g. 2 counts that score twice in the parent category, or 0.5 counts half as much as a default score of 1 counted once).
For Natural aggregation, the number entered will be the percentage out of 100 for that grade item or category (e.g. 25 to count for 25% or 1/4 of the total). With Natural aggregation, the values for all of the grade items in a category, or subcategories in a parent category must add up to 100, or 100%. If the total of all items weighted does not add up to 100, Moodle will scale the amounts to make them add up (e.g. if there are 3 items weighted 10, 10, and 30 [for a total of 50], Moodle will scale the total up twice to equal 100, and multiply each item by the same amount, resulting in weights of 20, 20, and 60). For this reason, it is recommended to add all main subcategories before weighting them, even if this means creating empty 'placeholder' categories.
For more detailed descriptions of how each method uses weighting, see the Moodle Gradebook Aggregation article.