The minimum requirement is to stress relieve when required by the applicable design code. I believe Stanweld has indicated the portions of ASME VIII Div 1 that are applicable.
Beyond the minimum requirements, end users may want to stress relieve to address concerns with specific service environments. For example, it is typically required to stress relieve vessels that will be used in sour service. However, to get into a discussion of all the possible reasons that an end user may require stress relieving beyond code requirements is really outside the scope of these forums.
Additionally, stress relief is required for vessels in Lethal Service per UW-2 of ASME VIII. There are also a number of services that strees relief is required to mitigate or eliminate the possibility of stress corrosion cracking.
Code PWHT requirements are primarily based on thickness and a chemistry that will produce a martensitic structure upon weld cooling during the welding process.