I will give you a few hints for NRW; you can look up the legal texts yourself:
Sections 32 to 39 of the Neighbor Law for the State of North Rhine-Westphalia regulate the obligation to enclose, the nature, location, costs of construction, and costs of maintenance of the enclosure, along with the specification of various exceptions. An enclosure is a facility erected directly on the property boundary (see in detail § 36 of NachbGNRW; deviations apply to demarcations erected by property owners along the property boundary but still on their own property) that separates a property from neighboring properties and protects it against unauthorized entry and impairments originating from the neighboring property. Enclosures are therefore fences, walls, or hedges.
According to § 32 of the NachbG NRW, if one neighbor demands an enclosure, the other neighbor is obliged to join with them in creating an enclosure (exceptions are regulated by § 34 of the NachbG NRW). This must then be erected on the property boundary. If a neighbor does not cooperate in the construction of the enclosure within 2 months after a written request, the neighbor demanding the enclosure may construct it alone and request partial reimbursement of the costs from the neighboring party. However, even in the case of joint construction of the enclosure, the law provides for cost sharing. A neighbor who refuses to cooperate in the construction of the enclosure thus gains no financial advantage and forfeits the opportunity to influence the specific design of the enclosure. Furthermore, § 38 of the NachbG NRW also provides for cost sharing for the maintenance of the enclosure (for example, painting a fence or trimming a hedge).
The law does not mandate a particular type of enclosure. However, public-law provisions (e.g. a municipal statute or a zoning plan) may need to be observed. Otherwise, the neighbors are free to make an agreement on the type of enclosure and its height (§ 49 of the NachbG NRW). They can therefore also agree on a tall privacy fence. If no agreement is reached, an enclosure that is customary in the locality must be chosen (§ 35 of the NachbG NRW). An enclosure is customary if it occurs more frequently in the affected district or in a closed settlement, which can easily be determined by inspection. If one neighbor constructs the enclosure alone due to lack of cooperation from the other, they must also choose a customary enclosure. If a customary enclosure cannot be determined (or the neighbors cannot agree), an enclosure about 1.20 meters high, such as a wall, wire fence, wooden fence, or hedge, must be erected. A tall privacy fence is then not permitted. According to § 903 of the Building Code, every owner may erect boundaries on their own property along the border according to their own preferences. However, this applies only insofar as they do not violate the duty of neighborly consideration. If the owner protects their property more strongly against observation than a customary enclosure would allow (tall privacy screens or similar), this construction measure constitutes an evasion of the provisions of the Neighbor Law for the State of North Rhine-Westphalia, which the neighbor does not have to accept.