* Oi is a more casual greeting, similar to "Hi" in English.
* Olá is a more formal greeting, similar to "Hello" in English.
Both are perfectly acceptable ways to greet someone in Portuguese, and the choice between them depends on the context and your relationship with the person you are speaking to.