It is a literal translation of a colloquial Cantonese expression, 加油(加-add, 油-oil), which means "to cheer up","to stimulate". in English; (Gambatte Kudasai)---to keep your chin up, in Japanese.
This Idiom came from the English idiom "Burn the midnight oil". Originally, when a person knows that you are going to stay up late for work, she will "add oil" to you, so that you will "have enough oil to burn" in the midnight. If you find it hard to understand what I am talking about, don't worry, I have another analogy. If you are driving from LA all the right down to Meixco, you will probably run out of fuel. So you need to refuel your car from time to time. In this case, the car is like "the person who needs to be encouraged"; the action of refilling gas resembles that of "adding oil". Is it clear?
The idiom has been widely used by Cantonese people to encourage their friends who need to stay up, which in turn speeds up the development of the meaning of this idiom. The meaning of the idiom has evolved and extended. Now, it can be used in every circumstance when people need encouragement, not just at midnight.
The phrase加油 also appears in a commonly used Chinese idiom 火上加油(Add oil on the fire). "Add oil on the fire" has a derogatory and figurative meaning which says that people aggravate the problem, or solve problem with unappropriate means. If you can interpret the connotation, you will find that the meaning of this Add Oil deviates from that mentioned earlier.
Add Oil is only used on Internet. People are just too lazy to type Chinese. However, in daily conversation, we still use the Chinese form of Add Oil. That means we do not say "Add Oil", we say "加油" to other people.
Interestingly, the English literal translations of Chinese expressions are frequently applied by Hong Kong people in chat rooms, or on ICQ, MSN, Xanga and etc. It is a common phenomenon that people mix Cantonese with English in daily conversation, e.g. 我去shopping (I go shopping).and use Hong Kong-made English, like add oil.