Capacity planning is the allocating work to iterations based on the number of story points a team believes they can achieve. It is closely tied with estimating. The goal is to achieve a sustainable pace that can go on forever. A lack of planning should not result in over commitment or a burst in velocity.
Assume no distractions (aka "ideal hours").
Include time for backlog refinement (~10-15% for each team member).
Include time for architectural and other enabler stories and features.
Plan at 70% and you will run at 100%. In fact, studies show that individual contributors are on-task only 60% of the time (and managers only 40%).
Like relative estimating, capacity planning requires a reference point on which to compare one's expectations. A brand new team (or release train) has no idea how many story points they can accomplish in an iteration. So, start new teams off with the following capacity calculation:
Pick out a story that would take about a half-day to develop and a half-day to test. That's our base story size. (So, if the team had sized it as a 1, then 1 is the base story size. If they had sized it as a 10, then 10 is the base.)
For every full-timer on the team, add 8 x the base story size. (Adjust for part-timers.)
Subtract the base story size for every team member on a vacation day or holiday.
Never look back. The team will adjust and come to a fresh consensus on its relative sizes in the upcoming iterations.