Is use of schools' rooftops a common thing in Japanese culture or just a cliché?
I am sorry, but they look like just a cliché....

From this Quora answer (yes Quora!):


  While many Japanese schools do have flat rooftops, they are usually off-limits and properly locked. So, eating your lunch on the roof or confessing your love at sunset up there... not gonna happen.


Source: Quora

Another source directly from our own Anime and Manga StackExchange: AM StackExchange

A quick Google search also reveals this (unfortunate) truth.