The Japanese equivalent of “Thank you” has variants depending on the tense. If you want to thank someone for something that he is doing, is going to do, or repeatedly does for you, you say Arigatō gozaimasu ありがとうございます. To thank someone for what he has already done for you, however, you say Arigatō gozaimashita ありがとうございました. For example, if someone has just invited you to a party that is to take place next week, you say Arigatō gozaimasu. After the party, however, you say Arigatō gozaimashita, meaning “thank you for what you did for me.” Likewise, as you accept a present from someone, you say Arigatō gozaimasu, but next time you see him, you thank him again by saying Arigatō gozaimashita. The difference in usage between these two forms remains even when dōmo どうも “very much” is added for emphasis. Dōmo arigatō gozaimasu どうもありがとうございます function like Arigatō gozaimasu, and Dōmo arigatō gozaimashita like Arigatō gozaimashita, except that the versions with dōmo are more polite than the ones without.
The informal version Arigatō ありがとう(without gozaimasu ございます or gozaimashita ございました) may be used regardless of the time of the event for which you wish to show gratitude. This version, however, cannot be used when speaking to someone higher in status. Since it is difficult for nonnative speakers of Japanese to determine who is higher or lower than they are, the safest thing would be to use Arigatō only when talking to a child. Otherwise, use the full form Arigatō gozaimasu (or gozaimashita) ありがとうございます（ございました）, or simply Dōmo どうも.
Unlike “Thank you”, Arigatō gozaimasu ありがとうございます and its variants may not be used in response to compliments. If someone compliments you for your “excellent Japanese”, for example, say Iie madamada desu いいえ、まだまだです “No, still not.” Thanking someone for a compliment, to the Japanese way of thinking, is like admitting you deserve the compliment; it is therefore an act of conceit.