It depends — "to" is lowercase as a preposition in AP and Chicago Style, and the infinitive "to" follows the same rule.
"To" is one of the trickier words in title capitalization because it serves two grammatical roles: as a preposition and as the infinitive marker before a verb. Its capitalization depends on which role it is playing and which style guide applies.
Some editors debate whether "to" before an infinitive verb should be capitalized because the whole infinitive phrase functions as a content word. However, Chicago Style, the dominant guide for book publishing, explicitly keeps the infinitive "to" lowercase.
NYT Style capitalizes "to" along with most other prepositions. This means a title like "How to Win Friends" would appear as "How To Win Friends" in NYT Style.
The opening position always overrides the preposition rule. "To Kill a Mockingbird" correctly capitalizes "To" because it is the first word of the title.
When "to" is used as a preposition — indicating direction, recipient, or relationship — it is lowercase in AP Style, Chicago Style, MLA Style, and AMA Style. Chicago Style explicitly lists the infinitive marker "to" as a lowercase word as well.