Hamiltonian lattice gauge theory with physically observable local degrees of freedom In my answer at What, in simplest terms, is gauge invariance?, I mentioned that in certain contexts there can be a "gauge theory" with a local symmetry that leave the Lagrangian/Hamiltonian invariant and whose degrees of freedom are physically observable. My follow-up got very long, so I decided to address the Lagrangian and Hamiltonian cases separately. Here are my thoughts on the case of a lattice Hamiltonian gauge theory - anyone else is of course welcome to contribute their own.  I address the Lagrangian case at Lagrangian gauge theory with physically observable local degrees of freedom
 A: Hamiltonian gauge symmetries usually come up in the context of lattice gauge theory, in which the system is defined on a discrete lattice.  Such a Hamiltonian is defined to have a gauge symmetry if it commutes with some extensively-scaling set of local (i.e. finitely-supported) unitary operators $\{ U_i = e^{-i Q_i} \}$.
Operators that commute with the Hamiltonian do not change with time, so one immediate consequence of this definition is that the values of these operators are constants of motion.  The Hilbert space therefore decomposes into different sectors corresponding to the different configurations of $\{ Q_i \}$ "charge" eigenvalues.  This makes the diagonalization of the Hilbert space much easier, because the extensive set of constraints in each sector reduces the exponent with which the Hilbert space scales with system size.  This is analogous to how gauge symmetry guarantees conservation of charge in Lagrangian theories - but since a Hamiltonian is not Lorentz-invariant (since in only generates translations in time, not space), we no longer have a conserved four-current, but the stronger condition that the charges are completely fixed and can't move at all.  Also, a continuous global symmetry operator $U(\theta)$ that commutes with the Hamiltonian is a associated with a conserved total charge $Q$ if $U(\theta) = e^{-i \theta Q}$.  Here we have the must stronger result that $U_i = e^{-i Q_i}$ for each $i$ - we've "gauged" the symmetry so that everything is local - so we have that the specific charge configuration $Q_i$ is conserved, not just the total charge $Q$.
A concrete example is one of the simplest lattice gauge theories, the $\mathbb{Z}_2$ lattice gauge theory.  The Hamiltonian is
$$ H = -\sum_i \sigma_i^x - \sum_p \prod_{i \in p} \sigma_i^z,$$
where the $i$ are the edges of a square lattice, $p$ are the plaquettes, and $\sigma$ are Pauli matrices acting on spin-$1/2$s on the lattice edges.  The local charges are $Q_s = \sum_{i \in s} \frac{1}{2} (\mathbb{I}_2 - \sigma_i^x)$, where $s$ denotes a "star" of four adjacent edges that meet at the vertex $s$.  The possible eigenvalues of $Q_s$ are $\{ 0, 1, 2, 3, 4 \}$, but for the $\mathbb{Z}_2$ case only the parity of the eigenvalue is physically significant.  The local unitary symmetries are $U_i = e^{-i \pi Q_i} = \prod_{i \in s} \sigma_i^x$ (it's convenient to choose $\theta = \pi$ to simplify the overall scale of $Q_i$).
In practice, the local symmetry is often more than just a useful way to decompose your Hilbert space and simplify your numerics (although it is very useful for that).  There is often a physical argument that "physically reasonable" eigenstates must be left unchanged by the symmetry operators - i.e. not only must they be an eigenstate of each $U_i$ (which is automatically guaranteed because $U_i$ commutes with the Hamiltonian), but they must be an eigenstate with eigenvalue 1.  In other words, the physical subspace - the simultaneous eigenspace of every $U_i$ with eigenvalue 1 - is "gauge invariant" and left unchanged by local symmetry operators, while the unphysical states are "gauge dependent" and pick up phase factors.
In the simple case where the gauge fields are not coupled to any dynamical matter fields (which must themselves transform nontrivially under gauge transformations), $U_i = e^{-i Q_i}$ implies that the physical subspace is the one with no charge anywhere.  (This is why gauge charges are sometimes called "topological gauge defects" - they're localized "defects" in the gauge symmetry which are topological/nonlocal because (a) you can sense their presence from arbitrarily far away via Gauss's law and (b) you can only create them in combinations that are net charge-neutral - you can never create just one gauge charge, because charge is locally conserved.)  Gauge fields can be coupled to dynamical matter fields - as in E&M - but only if the coupling is also gauge-covariant.
There are two possible reasons for why the charged sectors could be "unphysical."  One possibility is simply that there's a large energy gap to create a charge, and at temperatures far below that gap, the probability of creating an excitation is exponentially supressed.  In this case the charged sectors aren't really "unphysical," they just have extremely low occupation weights in the thermal density matrix at low temperatures, so you're unlikely to find one.  This is what we call an "emergent gauge theory" in condensed matter, because the gauge symmetry only "emerges" at low temperatures.  In this case, the "gauge dependent" degrees of freedom are directly measurable, just rare.  The other possibility is that the charged sectors really are physically impossible.  This usually comes about because your Hilbert space contains "dummy" degrees of freedom that you just tacked on for mathematical convenience, and it just literally wouldn't mean anything in terms of your original physical degrees of freedom for the charge degrees of freedom to be nonzero.  For example, this is the case in the slave particle formalism.  In our $\mathbb{Z}_2$ lattice gauge theory example above, one could clearly measure the "gauge dependent" quantity $\prod_{i \in s} \sigma_i^x$ - but just as in the Lagrangian case, the probe itself would need to explicitly break the gauge symmetry; the material can't "see" gauge violations within itself.
It's often convenient to split an arbitrary vector into the direct sum of a component in the physical subspace and a component orthogonal to it.  The component in the physical subspace determines all the state's physical properties - the orthogonal component is "pure gauge."  We therefore say that two states are physically equivalent if they have the same projection into the physical subspace.  There's an easy method called the "Gutzwiller projection" to perform this projection that doesn't require factoring the Hilbert space: starting with any state $| \psi \rangle$, you simply take the uniform superposition over the "orbits" of $Q_i$, i.e. $|\psi\rangle + Q_i |\psi\rangle + Q_i^2 |\psi\rangle + Q_i^3 |\psi\rangle + \dots $ over the whole group for all $i$, then normalize. (For Lie groups you have to integrate over the whole group with respect to the Harr measure, but the idea is the same.)  The superposition cancels out the gauge-dependent part and leaves only the gauge-invariant part; to see this, note that acting $Q_i$ on this state just permutes the summands and leaves the sum invariant.  The Gutzwiller projection provides a quick way to test whether two states are physically distinct or just gauge transformations.
Why do we bother with Gutzwiller projections instead of just always working in the physical subspace?  Because gauge-invariant states are sometimes much more complicated to write down than gauge-dependent ones.  If we start with a product state in the position basis, often each term in the Gutzwiller projection will be orthogonal to the previous ones, and we end up with a huge linear combination.  It's often easier to just work with the original product state and not perform the Gutzwiller projection until the very end of the calculation.
