The Internal Revenue Service requires that some improvements be capitalized and that the expenses related to them depreciate over their useful life. For example, fences are considered a capital improvement and have a useful life of five or seven years, depending on the amortization method you use. All capital improvements in your home are tax-deductible. You can't claim the deduction until you sell it, when the cost of upgrades and other improvements is added to your property's cost base.
The IRS defines a capital improvement as a home improvement that adds market value to the home, extends its useful life or adapts it to new uses. Minor repairs and maintenance work, such as changing door locks, repairing a leak, or fixing a broken window, are not considered capital improvements. IRS Publication 530 specifically lists the construction of a fence as an example of home improvement. Home improvements can't be deducted from your taxes.
However, they increase the tax base of your home, meaning that you won't have to pay taxes on the value of an improvement when you sell your home.