The law contemplates a division known as a medianerio/medianera which could be a fence or wall that serves as a division between two properties and agreed by both neighbours. This can be two meters in height so approx. six feet. There are also rules and guidelines laid down by your town hall known as ‘normativia urbanistica’. Often these walls are what is known as forced (compulsory).
There are also borders which are not shared by the neighbours which can consist of trees, vegetation, dried plants, reeds, nets or screens. These can also be of two meters but must comply with the law or the town halls normativas. These boundaries must be planted on own land and respect the rules.
A further boundary put up where there is already this dividing boundary described in the first paragraph, should not obstruct balconies windows or other features. In the case of this personal boundary Bushes should be one meter from the dividing line and if trees two. I can find no mention of a wall or fencing but suggest that should also respect the distance from the middle boundary if exists.
The trees planted on your land is your responsibility if they cause any damage to the neighbouring plots. This would be the case if the tree fell due to lack of care and maintenance. A neighbour cannot claim damages if the fall is due to lightening or a fortuitous act.
Overhanging branches. The neighbour should advise the owner of the need to prune the trees. Should the owner not do so, the neighbour can prune back but only to the boundary line.
The above are some guidelines based on the law and suggest that for further information you visit the planning department of you town hall to check their regulations.