Both term and duration refers to the period of time during which something continues.
Term is a legal word, when used as a time factor, it relates to the period while the contract is operative. The term of the contract or any other legal relationship is the period between the commencement and the expiration.
Examples:
"term of the contract"
"term of the loan"
"term of a board member"
"term of employment"
"term of confinement"
The word "term" is also used in the description of a legal concept, generally referring to a version which lasts for a certain period as opposed to the one which is terminable by simply giving a notice.
"term lease contract"
"term deposit"
Duration is an everyday word meaning the time during which something exists or lasts. It is very similar to "term" but it used primarily for events in everyday life.
"duration of the concert"
"duration of services"
"duration of the holiday"
"duration of the workshop"
"duration of the business trip"
"duration of the war"
"duration of the project"