There is a global setting for showing or not showing line numbers on code samples in your book's Theme, which you can find more information about here.
Line numbers on code samples are set to be shown by default in our Nonfiction, Technical, and Fiction book Themes.
If you choose a "Custom" theme, you can choose to turn line numbers on code samples on or off for your whole book (make sure to click the blue button at the bottom of the page to save the change!):
You can also adjust this setting on individual code samples, overwriting the global setting on that particular code sample: