For standard usage:
When a button is clicked, the text entered into the textbox will be set into the variable. Clicking normal links will ignore the text. (This allows normal links to serve as a “cancel” or “go back” operation, allowing the player to navigate without unintentionally altering the variables.)
As mentioned, the inputted text is ignored by Twine unless a button is clicked, which acts as a way to “submit” the text into the given variable. There is a way to create a button without using an extra <<button>> macro. Simply add a link as an extra argument to the macro:
<<textinput $variable [[link text|passage name]] >>
This creates a button immediately after the text box, which functions accordingly.