Whenever you raise oxygen, raise temperature, or flip an ocean, you gain 1 TR. This happens for each step you raise those parameters.
During the phase in which a global parameter reaches its maximum (temperature at +8°C, oxygen at 14%, or 9 ocean tiles flipped), all players can continue to take actions or play cards to increase that parameter. They will receive all of the benefits, such as forest VP and TR. During the phase that the last ocean tile is flipped, any player who continues to take actions or play cards to flip oceans will gain the reward on the last ocean tile that was flipped in addition to the TR.
After the phase in which the parameter reached its maximum, players can no longer gain rewards for increasing that parameter.
Players may continue to gain forest VP tokens for building forests after the phase when oxygen reaches 14%, but won't gain TR for increasing oxygen when they do.
Important Rule: At the end of the action phase, if you are able to spend heat or plants for a standard action, you must do so unless the associated terraforming parameter has already been raised to its maximum.