Minecraft wiki entry for Anvil, associated text: Any repair/enchant/rename operation may be done, regardless of the player's experience level.
The experience cost is not taken from the player.
The repair cost of tools does still increase.
It will keep doubling with each repair, past the usual limit of 39 levels.
When it reaches the capacity of signed 32-bit integers, no repair cost is shown and the "product" item cannot be taken out of the anvil. Tools in this state also cannot be renamed or enchanted.
Anvils are not damaged on use.