If every registered voter in a precinct cast their ballot...

could that polling place close early? Has that ever happened? Does it vary by state?

Just a WAG, but if every single registered voter cast their vote, the precinct would probably be open late, since the precinct would be overwhelmed and not prepared for the turnout. On the other hand, there are small precincts that have already announced their results for this cycle.

Dixville Notch reported shortly after midnight, in their traditional publicity stunt, as all 21 of their registered voters had voted.

My WAG is that (in most jurisdictions) they cannot close, because someone may turn up and claim a provisional ballot.

I’ve seen cases where they closed early for primaries if everyone voted (some of these are minor party primaries which may only have a couple of eligible voters in the district). There’s no reason to stay open.

We can register to vote on election day here in Minnesota, so I’d assume they’d stay open in case somebody new showed up.

And this traditionally Republican town voted 15-6 for Obama. They reported the totals immediately after they closed just after midnight.

I am pretty sure it varies by state.
New Hamp allows the polling place to close according to the news.
In Louisiana, I believe they have to stay open no matter what.

Absolutely – state law requires them to be open to 8pm, with no exception for “everyone has voted already”.

There was an exception slipped in to law recently that allowed polling places in rural townships to not open at 7am, but to delay it until as late as 10am. This has already caused reported problems in Minnesota, as people arrived early in the morning and found that the polls weren’t open. And for people who work late shifts, that makes it hard to get home from work in time to make it to vote. (There will be a strong effort to remove that exception as soon as the Legislature gets into session in January!)

When I was a kid the precinct included two houses. four registered voters. Each precinct had to have three board members. My dad worked nights and did not get home until 8:30 AM. The neighbors would come over at 8:00 AM and open the poles. Dad got home around 8:30 they would all vote then close the precint.