There's a certain amount of latitude; different speakers make the choice between the two variants differently. But both variants occur, and sometimes the choice may seem random. For example, there are two novels - A Room at the Top and A Room with a View, and the vowel lengths vary (it seems to me) to match the length of the vowel in the other word (a sort of long-range form of phonetic assimilation): /ʊ/ /ɒ/ in the first, and /u:/ /u:/ in the second [that's my idiolect; some speakers would probably balance the vowel lengths: /u:/ /ɒ/ and /ʊ/ /u:/ - so that each title has one short vowel and one long!]
But there are no hard and fast rules that I know of - sorry , not very satisfactory, but there it is...
PS Seeing your provenance, I think I could have shortened my answer. In RSP I believe the vowel is usually something like /ʊ/ (but with rather more lip-rounding than we do South of the border) in both cases. This vowel is often transcribed in literary works as 'ui' - as in 'Guid grief mon'!