Let I := (a, b) be a finite or infinite interval. We assume that p(0)(x), q(0)(x) and p(1) (x) are real-valued measurable functions on I, p(0),p(0)(-1),p(1)(2)p(0)(-1) and q(0)(2)3p(0)(-1) are locally Lebesque-integrable, i.e. belong to L-loc,(1)(1), and w(x) is a positive function almost everywhere on 1. Consider the operators generated in L-w(2) (I) by the formal differential expression l[f] w(-1){-(P(0)f')' + i[(q(0)f')' + q(0)f']+P(1)f}, where the derivatives are understood in the sense of distribution. The method described in this paper gives the ability to correctly define the minimal operator L-0 generated by l[f] in the space L-w(2) (I) and include it in the class of operators generated by the second order symmetric (formally self-adjoint) quasi-differential expressions with locally integrable coefficients. Thus, the well-developed spectral theory of second order quasi-differential operators is applied to the Sturm-Liouville operators with distribution coefficients. The main goal of this work is to construct the Titchmarsch-Weyl theory for such operators. The central problem here is to find the conditions of the coefficients p(0), q(0) and p(1) when the limit-point or limit-circle cases can be realized. The obtained results are applied to the Hamiltonian theory with delta-interactions, i.e. when l[integral]= -integral" + Sigma h(j)delta (x - xj) integral, where h(j) is a strength of the interaction at the points x3, and to the associated Jacobi matrices.