Permits for Half Dome must be reserved on recreation.gov. They are done on a lottery system, so there is no guarantee that you will get a permit. To apply for a permit, fill out the form on recreation.gov, and pay the 10 dollar application fee. The lottery for preseason permits opens March 1st, and closes March 31st, and the notification of the results is sent out April 10th. Lottery winners must accept and pay for their permits by the set acceptance date. Cables for Half Dome are typically installed on the Friday before Memorial Day, in late May. However, if weather restricts the installation of the cables, and they are not up by the date of your permit, the National Park Service will refund the permit fee (but not the application fee). Unfortunately, it is not possible to switch the dates on awarded permits.
If you did not apply in time for the preseason lottery, or did not receive permits in your preseason application, you can apply for the daily lottery two days out from when you wish to hike Half Dome, starting May 22nd (when cables are installed May 24th). For instance, if you desire to hike Half Dome on June 3rd, you can apply for the daily lottery on recreation.gov on June 1st. Cables are taken down most years on Columbus Day, in the middle of October, therefore, the last day to enter the lottery for permits is two days before Columbus Day. Recreation.gov has a chart with all the dates for the year for further reference.
There are about 225 permits per day that are available in the preseason lottery. At least 50 permits are available for the daily lottery. The main takeaway here is to plan and apply early for the preseason lottery; and if you are not selected for a permit, be flexible and apply for the daily lottery as many days as you can.