This obviously depends on your local building regulations and you need to check as they may have specific requirements about total size and distances from public roads, utilities, fences, etc However, in most places, the accepted definition by planning authorities is that a pergola is not considered a permanent structure. In most places, the concern is going to be over the height and as pergolas have a flat-top and do not have a pitched solid roof, that can interfere with sightlines of nearby properties, they often get treated more leniently than those structures that do, such as a Ramada. If you are planning an attached Pergola then there may well be additional regulations relating to the fixings and method.