Specifically in wheat and potato breads, what is the purpose of adding oil or butter to the dough?
I have always assumed it was just for flavor, but I suspect there is some background chemical reasons for adding it.
Breads get their structure from glutens--a type of protein formed by the combination of glutenin with gliaten. Kneading and resting the dough helps the formation of glutens--I assume by shifting glutenin and gliatin molecules around, this increases the odds of bindings occurring.
Oils can bind to glutenin and gliatin and inhibit these reactions, so fats--oils and butter--definitely play a role in the texture control.
It prevents the dough from getting too elastic, which controls texture. This elasticity change would also change the maximum air bubble size. Altering resting times and yeast quantity also change these, but trading off for a different flavor. Oil may play other roles, but these are what I recall reading about off the top of my head. Yes, it does contribute to flavor as well.
As Eric Hu said in a previous answer, oil reduces the formation of gluten, therefore affecting the elasticity of the dough.
From the chemical and physical point of view, without altering other variables (yeast, rising time, salt, amount of liquid,etc) a dough with less or no oil will me more elastic, allowing bigger bubbles and giving the bread a chewier texture.
This is the case of French bread, for instance; French bread requires longer rising times to develop flavors, slower yeast activity (achieved by adding more salt to the dough), and no oil or fat, to get a more elastic dough and achieve its characteristic texture.
Personally butter and oil adds a particular flavor to bread and in fact the bread looks like cake and seems like chocolate cake. When the bread especially the local type called kumba bread that I produced is oiled with enough butter inside before baking, the bread comes out from the oven very bright and having that coffee brown color so attractive to eat.