Which one is correct? and why?: 1. Where had Robert been working since 4 o'clock yesterday? 2. Where was Robert working since 4 o'clock yesterday?
Using past perfect or past perfect continuous requires a reference time point in the past up until which the events had been taking place. There is none in your sentence. So, without context, I'd say that using past perfect continuous is unwarranted.
However, more context could make past perfect continuous work.
I met Robert at 7 o'clock yesterday. He said he had just finished work. But I hadn't seen him in his office since 4 o'clock. So where had Robert been working since 4 o'clock?
Here 7 o'clock is the reference time point in the past.