A US judge has ordered actor Johnny Depp to stay away from his estranged wife, actress Amber Heard, after she alleged he assaulted her.