I hear three different sounds for the letter e in precious, bean, and Peru.
Is there a rule that covers the different pronunciations that a written letter e can represent in speech?
The letter e in English commonly makes two different sounds:
The "long" e is [i] in IPA, and is found in words such as keep, bean, read, and compete. It's generally spelled with a digraph such as ee, ea, or eo, or is indicated by a final silent e in the word.
The "short" e is [ɛ] in IPA, and is found in words such as bet and left. It's generally spelled with a simple e followed by one or more consonants.
The names "long" and "short" for these sounds is completely conventional, as they don't have anything to do with vowel length in modern English.
The sound which appears to be giving you trouble is [ə], the schwa which appears in unstressed syllables. In English, any vowel can reduce to [ə] when it becomes unstressed, and therefore [ə] can be spelled by any vowel letter. If you are simply trying to find out how a written word is pronounced, this makes things rather easy, since any unstressed vowel is likely to be pronounced as [ə]. On the other hand, if you're trying to figure out how to spell a word whose pronunciation you know, this makes things very hard, since the [ə] sound could be spelled with any vowel.
There are exceptions to all of these rules, since English spelling is a disaster, but this should get you started. When in doubt, you should always consult a dictionary to see how a word is pronounced or spelled.
The letter e has more possible sounds than any other letter in English. The best way to learn how it is said in any given word is to listen to native speakers and to look it up in a quality dictionary.
As for when it becomes schwa, you just have to know (learn by rote example) which unstressed syllables reduce to schwa and which ones do not. For example, the verb document has an unreduced, unstressed e, but the noun reduces it. See Stress and Vowel Reduction in English for more about the same, including that specific example.
This can sometimes vary between speakers; some speakers see Rosa’s
As the most frequently used letter in the English language, and the one that can produce the most distinct sounds depending on the word it is used in, the OED article on the letter e is especially, perhaps even extravagantly, long and detailed. I below present a tiny clipping from the much larger article. I’ve added some notes for sounds that a rhotic speaker would not generate, and which indeed under alternate analyses, do not even exist.
It then goes on to detail eight such digraphs — ea, eau, ee, ei, eo, eu, ew, ey — and give multiple examples of each, since almost all of those can have multiple possible sounds.
Following that it explains how the situations where e is silent “are very numerous”, and details six situations in which this occurs. Before those, however, it states:
One should read the entire entry, of which this is just an extremely brief and summarized excerpt, to get the more in-depth treatment.