what are 词 whose whole word meaning is different from meaning of its components called?
They are compound words  

Most characters have multiple meanings, in many cases an individual character in a compound word can also be a short form for another word 

Example:

"天真" is combination of two adjectives


天 means 天然 (natural) 
真 is short for 純真 (pure/ innocent)
"天真" = natural + innocent = naive


As for "馬上", it is a combination of a noun and a  preposition

"馬上" literally means "on the horse" . To get to the meaning of immediately, you have to use some extension of logic. When a rider mounted his horse, the departure is immediate, therefore,  "馬上" is used for the meaning of immediately.

There are many ways compound words are coined, you just have to memorize every individual compound word, like you would memorize every individual English word