i came to a situation once when i say 'thanks' to someone and he corrected me on the spot that i should say 'thank you'! Is that a must when talking to someone that in a formal situation we should say ' thank you' instead of 'thanks' ? Please guide me.
It is true that thank you is more formal than thanks.
It is difficult to say exactly when each one is appropriate. If I were being handed my degree certificate during a graduation ceremony, I would say thank you. If someone passed me the salt at table, I would say thanks.
I reckon nona the brit's explanation is absolutely right. Another important thing I want to add is apart from the degree of formality, you should take your familiarity with your interlocutor into consideration as well. While it does no real harm to say 'thank you' or just 'thanks', but by using longer expressions, you'll gain respect and acceptance. At least in the scenarios you quoted! Best of luck.