"Contact" sports, like boxing or American football, tend to use the term "referee." "Non-contact" sports, like cricket or baseball, tend to use the term "umpire."
However, there is no sure difference between the terms, and some sports use both terms for different officials, as sdgraham just mentioned. You have to learn the jargon of the particular sport to know which term is used.
Outside of sports, "referee" is a legal term. A court of law might refer some technical question about computers, for example, to a referee who's a specialist in computers. I don't know of any use of "umpire" as a legal term.