What's the main difference between 为 and 是? It seems like both 为 and 是 mean "to be". In which cases is one used but not the other? Is it something like the difference between "estar" and "ser" in Spanish and Portuguese? (In the sense that one is constant in time while the other is transient). Thanks.
为 has a lot meanings, and so does 是. A common meaning between 为 and 是 is "to be" or other variations of "to be", like "being". 为 is used more for its other meanings than "to be", while 是 is used more for "to be" than its other meanings. When meaning "to be", in some cases, 为 and 是 are interchangeable. For example: 


  
  我们今年的工作目标 为 ... 
  我们今年的工作目标 是 ...
  


But there are some cases where 是 cannot be replaced by 为, for example: 


  Yes: 我 是 一名学生.
  No: 我 为 一名学生(X). 


为 has another meaning very close to "to be", which is "regard ... as ... " in the pattern of 以...为..., for example 


  以 厂 为 家, 以 人 为 本, 民 以 食 为 天, 以 救国救民 为 己任, etc. 


In this case, 为 cannot be replaced with 是. By the way, 为 and 是 can even be used together, like 自以为是. But here 为 means "believe", and 是 means "right", or "correct". 自以为是 means "consider oneself always right". 自以为是 is a derogatory term, used to show dislike, disagreement or disapproval.

Another example: 


  是为序。


Here 是 means "this", 为 means "is", 序 is "preface", so the whole sentence means "this is the preface". It is sometimes used to end a preface.

One more example: 


  何以为是，何以为非？无以为是，无以为非。 


Here both 是 mean "true" or "truth", both 非 mean "false" or "falsehood". All the 4 为 mean "to be". 

According to above-mentioned samples, 为 means that it is NOT xxx but very like xxx. In Chinese words, (可能它一定不是xx，但也可能它现在不是xx，将来可能是, 但)把它当作是xx。

Example: 以厂为家，厂 is not home，but someone treats it as home。 


  今年的目标为xx，i.e. 我们把xx当作今年的目标。 


为 implies that we assign a role to a thing actively/explicitly, but 是 implies that a thing does natively have the role.