Generally you can find what you are looking for by looking at what page you are viewing in the address bar and then looking for a corresponding tmpl file in the templates directory. This is true for most of the files in threads, not all, but most.
Of course, if you want your changes to show regardless of whether your users have their view set to 'Categories view' or 'Forums view' you will need to edit both.