How to show post counts in “Categories” and “Archives” menus in WordPress

The Categories menu shows category post links and the Archives menu shows links grouped by months.
By default, only the names of the categories and months are displayed in the menu.
If you would like to show post counts in each category/month, you can do this by editing the options of the widget.

To edit the Categories and Archives in WordPress,
you must first log in to the admin panel and go to Appearance menu>Widgets sub-menu.
You will see the two widgets listed in one of the widget areas (a sidebar or the footer).
Click on the arrow next to the name of each widget.
Mark the checkbox that says Show post counts and click the Save button.
Then click the refresh button. The post count will be shown in brackets.