Normally, we pronounce the with a short sound (like "thuh"). But when the comes before a vowel sound, we pronounce it as a long "thee".

vowel soundwritesay
athe applethee apple
ethe eggthee egg
ithe ice-creamthee ice-cream
othe orangethee orange
uthe u gli fruitthee ugli fruit

It is important to understand that it is what we say  that matters, not what we write. It is the sound  that matters, not the letter used in writing a word. So we use a long "thee" before a vowel sound, not necessarily before a vowel. Look at these cases:

we writewithwe saybecause
the houseconsonant hthuh houseconsonant sound
the hourconsonant hthee ourvowel sound
the universityvowel uthuh  youniversityconsonant sound
the umbrellavowel uthee umbrellavowel sound

Emphatic the [thee]
When we wish to place emphasis on a particular word, we can use "emphatic the" [thee], whether or not the word begins with a consonant or vowel sound. For example:

A:  I saw the [thuh] President yesterday.
B: What! The  [thee] President of the United States?
A:  Yes, exactly!

sources : Original Link