Michael is correct.
Chances are though that the existing pergola was never approved, so putting a roof on it you'd best to contact a private certifier and get it done.
If it was already approved as a pergola, no one will probably notice or care if you put a roof and gutter on it though. It...