The aim of hyphenation is usually to make things easier to read. In general, if the two words modifying the noun appear before it then they should be hyphenated. If they are post-modifiers then the hyphen is not necessary.
Here’s an example:
‘She was a well-known scientist.’
‘The scientist was well known.’
Hyphens can also be helpful in demonstrating that the two adjectives are combined.
A ‘first-class discussion’ is quite different from a ‘first class discussion’.
There are exceptions to any rule, for example if the left modifier has an -ly ending and the right modifier has an -ed then they are usually not hyphenated e.g. ‘a distantly related cousin’. Compound modifiers with comparatives or superlatives are generally not hyphenated either e.g. ‘the most recent change’.
If you’re not sure, check a dictionary or ask a proofreader.