They as a general matter, barring injury and such, have a set number. Different species vary in number, and this is commonly used as a test to tell one species from another, and some species show sexual dimorphism in vertebrae number.
The number is fixed from birth. The gene that does it acts very early on in development, and so they have no ability to generate new vertebrae during development.
The number they are born with is what they have for life, they just get bigger, same as you. When you grew taller, you didn't get more vertebrae and ribs. The ones you had just got bigger.
You should Google snake skeletons, they're pretty rad.