There is no rule for this and is mostly based on preferences. If the verb for the two actions are the same, you can choose if you want to omit it. However, in China, often one way of expressing is more fluent and more widely used than the other. The exact rule is difficult to describe, but it is likely based on the rhythm and flow of the language.
For example:
Saying 你喝咖啡还是喝茶?and 你喝咖啡还是茶?are both valid ways of expression, but the former sounds more rhythmically like a question and therefore is more often preferred.
On the other hand, 他学习英语还是日语?and 他学习英语还是学习日语?are also both valid, but the latter often sounds unnecessarily wordly and is often avoided.
P.S. In China, you may also often here people adding another word within these expressions to clarify what exactly they are asking. For example, 你喝咖啡还是喝茶?is ambiguous since we cannot really identify if it means "Do you want to drink coffee or tea" or "Are you drinking coffee or tea". For the former meaning, we often clarify by saying 你要喝咖啡还是喝茶?. For the latter meaning, we clarify by saying 你在喝咖啡还是喝茶?.