Motivated by concepts of classical electrical percolation theory, we study the quantum-mechanical electrical conductance of a lattice of wires as a function of the bond-occupation probability p. In the ordered or ballistic case (p = 1), we obtain an analytic expression for the energy dispersion relation of the Bloch electrons, which couples all the transverse momenta. We also get closed-form expressions for the conductance g(NL) of a finite system of transverse dimension N(d-1) and length L (with d = 2 or 3). In the limit L --> infinity, the conductance is quantized similarly to what is found for the conductance of narrow constrictions. We also obtain a closed-form expression for the conductance of a Bethe lattice of wires and find that it has a band whose width shrinks as the coordination number increases. In the disordered case (p < 1), we find, in d = 3 dimensions, a percolation transition at a quantum-mechanical threshold p(q) that is energy dependent but is always larger than the classical percolation threshold p(c). Near p(q) (namely, for small values of \DELTA\ = \p - p(q)\), the mean quantum-mechanical conductance <g(L)> of a cube of length L follows the finite-size-scaling form <g(L)(p)> almost-equal-to L(d-2-t/nu)F(DELTA-L 1/nu), where the scaling function F and the critical exponent nu are different from their classical analogues. Our numerical estimate of the critical exponents is nu = 0.75 +/- 0.1 and t = nu in accordance with results of nonlinear sigma models of localization. The distribution of the conductance undergoes a substantial change at threshold. The conductance in the diffusive (metallic) regime in d = 3 dimensions follows Ohm's law (it is proportional to L). As p --> 1, the crossover between the metallic and the ballistic regimes is governed by the scaling law <g(L)(p)> almost-equal-to L2K(L(1-p)). No percolation transition is found for d = 2 but as p --> 1, the crossover between the quasimetallic and the ballistic regimes is governed by a similar scaling law.