What limits are there on how I can vote?
How often can I vote? How do my votes become locked/unlocked?
The exact number of votes available depends on your voting behavior for the day. You get a total of 40 votes per day, which are broken down into 10 "Q-votes" and 30 "QA-votes" per day.
When you start the day off, the system will deduct from your Q-votes when you vote on a question, and deduct from your QA-votes when you vote on an answer. If you run out of your Q-votes, you can continue voting on questions, but it will deduct from your QA-votes instead. When you have five QA-votes remaining, you'll see a message "You have 5 votes remaining"; at this point you'll be blocked from using your Q-votes and any post you vote on will count against your QA-votes.
This means that if you vote mostly on questions in the beginning, you'll run out of your Q-votes first and will be able to reach 40 votes in a day. However, if you drop down to 5 QA-votes with Q-votes remaining, you'll be blocked from using those Q-votes, and you won't be able to reach 40 votes in a day. In other words, you can no longer use your Q-votes once you've voted on 25 answers that day.
The exact formula used by the system is described in this answer by Shog9.
Retracting a vote you cast on the same day will recalculate your voting allowance as if you never cast that vote. In most cases, you'll get one extra vote. However, if you had previously cast 25 or more QA-votes and are now under 25 QA-votes cast, your Q-votes will be unblocked, giving you more votes to use. If you were required to use QA-votes on questions when you had Q-votes available but blocked, those will be retroactively allocated to those questions up to the limit and you'll get back those QA-votes.
Retracting a vote you cast on a previous day will not change your daily vote allowance. (See Limits on changing votes below to know when you can retract your vote.)
If a post you've voted on is deleted the same day as you cast your vote, your daily vote allowance is also recalculated as if you never cast that vote, the same way as the above bullet. (This means that the number of posts you can vote on can exceed the normal 30-40 if posts you vote on are deleted.)
Upvotes can be cast by users with 15 or more reputation.
Downvotes can be cast by users with 125 or more reputation. (100 on Meta Stack Exchange)
50 close/reopen votes per day per user on Stack Overflow, Mathematics, Server Fault, Super User and Ask Ubuntu, 12 close/reopen votes per day per user on Stack Apps, 24 close/reopen votes per day per user on all other sites (source).
Close and reopen votes can be cast by users with the cast close and reopen votes privilege (3,000 or more reputation on sites with "full" requirements, 500 or more reputation on sites with "beta" requirements, and 15 or more reputation on sites with "private beta" requirements).
Users with the view close votes privilege (at least 250 reputation on sites with "full" or "beta" requirements and 15 reputation on sites with "private beta" requirements) can cast close and reopen votes on their own questions.
When you have five or fewer votes remaining for the day, a popup will inform you how many votes you have remaining after each vote you cast
If you reach the limit and try to vote again, a popup will indicate the number of hours you need to wait before voting again
You cannot cast a close or reopen vote on a question if you've previously cast such a vote and it successfully closed or reopened the post (that is, you're listed in the post history as someone who closed or reopened the question). The two vote types are checked separately.
If you've retracted a close or reopen vote on a question, you cannot cast the same vote on that question again.
Five delete votes per day per user, upon reaching 10,000 reputation
One additional delete vote per 1,000 reputation beyond 10,000, to a maximum of 30 delete votes
Delete votes can be cast on closed questions by users with the access to moderator tools privilege (10,000 or more reputation on sites with "full" requirements or 2,000 or more reputation on sites with "beta" requirements).
Users with the moderator tools privilege (see above) but without the trusted user privilege (less than 20,000 reputation on sites with "full" requirements or 4,000 reputation on sites with "beta" requirements) must wait until a question has been closed for 48 hours before voting to delete.
Users with the trusted user privilege (see above) may vote to delete closed questions immediately after closure, provided they have a score of −3 or lower, or else they'll be subject to the same 48-hour waiting period. Additionally, they may vote to delete negatively-scored answers, and vote to delete zero-scored answers in the Low quality posts, Low quality answers, and Late answers review queues.
If you have the moderator tools privilege (see above) and have delete votes for the day, deleting your own posts will deduct from those delete votes. (You can still delete your own posts even after running out of delete votes.)
Each user can cast only a single delete and a single undelete vote per post. This limit does not apply to moderators or the owner of the post.
In general, once you have voted, you cannot change or remove your vote. There are two exceptions:
Exception one: you may remove your vote within a five minute window from the time of the last vote you cast on that post.
Exception two: you may remove your vote after every time the post is edited (excluding grace period edits). If you cast a new vote after removing a vote under this exception, that new vote will have a new 5-minute window and will work exactly as above.
Notwithstanding the above two exceptions, if you vote and undo your vote on a post 30 times, your next vote on the post will be permanently locked in and cannot be retracted.
For all of the above bullets, changing an upvote to a downvote or vice versa will be counted as removing your previous vote and then casting a new vote.
To simply undo a vote — i.e. make it as if you had never voted in the first place — click the "lit up" vote button. The result will be that neither an upvote nor a downvote is active, and you can come back to vote any time you like. Only cast votes are locked in.
To reverse a vote — i.e. change an upvote to a downvote or vice versa — click the "unlit" vote button, as you usually would. There is no need to perform an undo first.
Close votes and reopen votes that haven't aged away can be retracted on any question which hasn't already reached the threshold to close or reopen. Retracted close and reopen votes still count toward your daily close/reopen vote limit, and you cannot re-cast another close/reopen vote on the same question.