By means of quantum Monte Carlo simulations we study phase diagrams of dipolar bosons in a square optical lattice. The dipoles in the system are parallel to each other and their orientation can be fixed in any direction in the three-dimensional space. Starting from experimentally tunable parameters like scattering length and dipolar interaction strength, we derive the parameters entering the effective Hamiltonian. Depending on the direction of the dipoles, various types of supersolids (e.g., checkerboard, stripe) and solids (checkerboard, stripe, diagonal stripe, and an incompressible phase) can be stabilized. Remarkably, we find a cluster supersolid characterized by the formation of horizontal clusters of particles. These clusters order along a direction at an angle with the horizontal. Moreover, we find what we call a grain-boundary superfluid. In this phase, regions with solid order are separated by extended defects—grain boundaries—which support superfluidity. We also investigate the robustness of the stripe supersolid against thermal fluctuations. Finally, we comment on the experimental realization of the phases found.