「他人の視線」はこの場合だと英語で「other people's presence」と言います。「視線」は普段「gaze」や「look」と言いますがカフェや図書館では他人の視線は目立てない限り自分に来ないので「他人の存在」にしました。
教室や図書館、カフェ等他人がいる環境では勉強に集中できるけれど、自室だと他人の目がないからついついほかの事をしてしまう。
I can concentrate in places where there's other people's presence such as classrooms and libraries, but in my own room or places where there's nobody else, I end up thinking about other things.
「他人の視線」は直訳すると other people's eyes ですが、この文脈では**「見られているという感覚」や「人目」**を意味するので、being watched や under observation のような表現を使うと、より自然に伝わります。
まず「他人の視線」自体は、
other people's eyes
the presence of others(他人の存在)
being observed(観察されていること)