Recently, several laboratory experiments on vortex dynamics and quasi-two-dimensional turbulence have been performed in thin (stratified) fluid layers. Commonly, it is tacitly assumed that vertical motions, giving rise to a three-dimensional character of the flow, are inhibited by the limited vertical dimension. However, shallow water flows, which are vertically bounded by a no-slip bottom and a free surface, necessarily possess a three-dimensional structure due to the shear in the vertical direction. This shear may lead to significant secondary circulations. In this paper, the three-dimensional (3D) structure and the decay properties of vortices in shallow layers of fluid, both homogeneous and stratified, have been studied in detail by 3D direct numerical simulations. The quasi-two-dimensionality of these flows is an important issue if one is interested in a comparison of experiments of this type with purely two-dimensional theoretical models. The influence of several flow parameters, like the depth of the fluid and the Reynolds number, has been investigated. In general, it can be concluded that the flow loses its two-dimensional character for larger fluid depth and larger Reynolds number. Furthermore, it is possible to construct a regime diagram that allows the assessment of the parameter regime, where the flow can be considered as quasi-two-dimensional. It is found that the presence of secondary circulations within a planar vortex flow results in a deformation of the radial profile of axial vorticity. In the limiting case of quasi-two-dimensional flow, the vorticity profiles can be scaled according to a simple diffusion model. In a two-layer stratified system, the decay is reduced and three-dimensional motions are significantly inhibited compared to the corresponding flows in a homogeneous layer.