I think the best way to answer the question is to explain what setup actually does:
When you run filebeat setup it will:
- If its the first time you run setup ever (against Kibana and Elasticsearch that is), it will create the filebeat-* index pattern, alias, index mapping and setup ILM.
- It will look at what modules you have enabled, and then install the relevant Ingest pipelines.
- It will look at what modules you have enabled, and then install the relevant dashboards.
As you can see, the setup command doesn't actually do anything on the local machine, it simply prepares your Elasticsearch (and kibana if any dashboards are included) to ingest and store the data.
Based on that, you simply want to run setup whenever you want to change something on ES/Kibana, for example if you upgrade, you enable a new module, or perform any changes on ingest pipelines yourself.
You could even run filebeat setup on a machine that isn't actually going to run filebeat in the end, but it could simply prepare your cluster with all the setup it needs, before deploying filebeat through something like automation.
So to answer your examples, you would only need to rerun setup from someplace if you update your list of modules, but not if you simply update filebeat.yml.
It is also good to mention that it often (though not always), will check if certain things exist the first time it starts up, but this is not always accurate, so running setup is usually the best way to go.
If you want to only install certain aspects of a module, for example if you are not interested in a dashboard, or your filebeat can only reach Elasticsearch and not Kibana, you can add certain options to only install what you want, and all of the commands are documented here: