Let Ω be a domain in ℝn, n >2, the boundary of which has a cusp point, pointing inside or outside the domain. The purpose of the paper is to characterize the traces on ∂Ω of the elements of the space H1(Ω) of functions with a finite Dirichlet integral. As a consequence one establishes the existence of a linear continuous extension operator H1 (Ω) →H1(ℝn) under the presence of an interior cusp point on ∂Ω. Theorems on domains with cusps are proved with the aid of results on cylindrical domains. In the space of functions with a finite Dirichlet integral in the exterior or the interior of the cylinder one introduces the norm, depending on a small parameter ɛ and generating a norm of the trace on ∂Ω as an element of the quotient space. The latter is placed in correspondence with an explicitly described norm of functions on the boundary, uniformly equivalent relative to ɛ. One constructs an operator of extension of functions from the exterior of the cylinder to Rn, preserving H1, whose norm is uniformly bounded relative to ɛ. For the optimal operator of extension from the inside of the cylinder one finds the asymptotic behavior of the norm as ɛ→0. From these results there follow similar theorems on functions with a finite Dirichlet integral inside and outside a thin closed tube (of width ɛ).