Products by category shows a hierarchy of the product categories. You can click on each category to view the products under it.
You can set the product category in product view -> accounting section.
You can create product category in the Sales -> Configuration -> Product Categories and Attributes -> Product Categories.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!