In this paper we investigate periodic lateral and vertical heterostructures of transition metal dichalcogenides (TMDs). Lateral heterostructures are constructed by the alternating metallic and semiconducting single-layer stripes of TMDs joined commensurately along their armchair edges and attain different states depending on the widths of constituents. While these heterostructures acquire a composite character with metallic state for narrow stripes, large stripes lead to the confinement of electronic states and function as metal–semiconductor junctions with a tunable Schottky barrier. The interface or boundary between constituent stripes has finite extension and allows charge transfer between them. On the other hand, the weak van der Waals interaction between layers sets the features of vertical heterostructures. Their interfaces are sharp: metal–semiconductor junction and Schottky barrier developed thereof can be induced even within a few layers. In the absence of dopants, we find minute charge transfer across the interface with negligible band bending in vertical heterostructures. The δ-doping of the semiconducting constituent by the metallic one forms strictly two-dimensional metallic electrons in a three-dimensional layered semiconductor and leads to crucial directionality effects and quantization of conductance. Our work unveils significant differences between lateral and vertical heterostructures.