We introduce differentiable stacks and explain the relationship with Lie groupoids. Then we study $S^1$-bundles and $S^1$-gerbes over differentiable stacks. In particular, we establish the relationship between $S^1$-gerbes and groupoid $S^1$-central extensions. We define connections and curvings for groupoid $S^1$-central extensions extending the corresponding notions of Brylinski, Hitchin and Murray for $S^1$-gerbes over manifolds. We develop a Chern-Weil theory of characteristic classes in this general setting by presenting a construction of Chern classes and Dixmier-Douady classes in terms of analog of connections and curvatures. We also describe a prequantization result for both $S^1$-bundles and $S^1$-gerbes extending the well-known result of Weil and Kostant. In particular, we give an explicit construction of $S^1$-central extensions with prescribed curvature-like data.