There's no simple way to predict this. The letter E is one of the most problematic letters in the English spelling system. In fact, a fairly large number of words spelled with E can be pronounced with either /iː/ or /ɛ/, showing that even native speakers don't follow any single pattern for pronouncing words spelled with this letter. The word epoch is one such word: it in fact has the pronunciations /ˈɛpɒk/ and /ˈɛpək/ in addition to /ˈiːpɒk/.
There is also variation between /iː/ and /ɛ/ in words like economic and evolution (the pronunciation of evolution with /iː/ is more common in British English than in American English).
You can sort of explain some of these things, but not in any way that's really useful for predicting the pronunciation of unfamiliar words. For example, ego is the Latin word for "I", and the use of /iː/ in the first syllable is consistent with a traditional rule for English pronunciation saying that a vowel letter in a Latin word is pronounced "long" (like the letter-name) in a stressed open penultimate syllable (a second-to-last syllable that ends in a vowel—following Latin syllabification rules).
In violation of that rule, the first syllable of the word era (from Latin aera) is often pronounced with a "short E" sound in American English (or the corresponding R-colored vowel, anyway: many American English accents merge some or all of the "short E", "short A" and "long A" sounds before an R sound).
Of course, the pronunciation /iː/ is quite common for words that start with E when the vowel is part of a digraph EA or EE, as in each or eel, but I assume you aren't asking about words spelled with digraphs like this.