I think that with a few exceptions,
おう is /oː/ within a single morpheme, and /ou/ when it crosses morpheme boundaries.
おお is always /oː/. The same thing is true of other kana pairs like
そう・そお, and so on.
For example, look at the following pair of words:
追う おう /ou/
王 おう /oː/
追う can be divided into the root
ow and the verb ending morpheme
u. The /w/ disappears before /u/, so we're left with /o/ and /u/ in separate morphemes, pronounced together as /ou/. The same thing happens with other verbs that end this way, so
思う is pronounced /omou/, not /omo:/. In contrast,
おう within a single morpheme, so it's pronounced as a long vowel /oː/. You can make any number of similar comparisons:
沿う そう /sou/
そう そう /soː/
One tricky case is forms like
行こう. If you follow the traditional analysis and call this the 未然形＋助動詞「う」, it looks like
う are separate morphemes, but that doesn't fit with our rule so far--this form is always pronounced /oː/, not /ou/. In fact, separating between
う is an artifact of analyzing Japanese in kana; romanizing makes things a bit clearer. Instead of
iko.u, we can divide it into
ik.ou, giving us the root
ik plus the hortative suffix
ou. Once we do so, we can see that
cross morpheme boundaries, so it makes sense that it's pronounced /oː/.
The above rule mostly works, but we can come up with some exceptions like
今日 /kjoː/ or
おはよう /ohajoː/. What do they have in common? They were historically subject to a class of sound changes called ウ音便. Let's look at these one at a time:
今日 was originally
今 /ke/ +
日 /pu/. The consonant /p/ turned into /Φ/ and then was lost, leaving /keu/. This was subject to the sound change /eu/ to /joː/, giving /kjoː/. Modern kana usage respelled
きょう to reflect this pronunciation, obscuring the fact that it began its life as two separate morphemes.
おはよう was originally the honorific prefix
御 /o/ + the root
早 /haja/ + the adjective ending
く /ku/. Again the consonant before the /u/ dropped out, giving /ohajau/, which was subject to the sound change /au/ to /oː/, giving /ohajoː/.
In both cases, the sound changes created long vowels that cross morpheme boundaries, and modern kana usage respelled them with an お段 kana plus
う. In cases like these, the pronunciation is /oː/ rather than /ou/.