Both 7 and 12, but importance is not a meaningful question. It is like asking which of the four automobile wheels is most important. You may need more music study to understand the answer.
These are first basics of music theory, and a good site is http://www.dolmetsch.com/theoryintro.htm
See sections 6 to 12, and maybe 31.
Western music has 12 notes (actually half steps or semitones) in the octave, called the Chromatic scale. Keyboards have these 12 keys in each octave. This is the full set of possible tones in the octave, but the entire full set is not used in any one key. Often 7 of the 12 are routinely used in songs (see below for which 7), but more can be added as special cases (sharps and flats). Skipping a black key is a whole step, like C to D, or D to E are whole steps, but E to F and B to C are half steps (no black keys there).
The black piano key between say C and D can be called C# (C sharp) or Db (D flat), as convenient to the scale (it is the same black key on the piano). However the C key is also the same as B# and the B key is also Cb (because there is no black key there but we still have half steps).
Guitars also have 12 frets per octave, and frets are half steps on the guitar too, and the 12 frets are the same idea, same chromatic scale. None of the frets are painted black however, so obviously frets are more important than piano keys (that's a joke). But you are also effectively asking which guitar frets are most important, which is NOT how it works.
Both 7 and 12 are important concepts.
In western music, the do-re-me-fa-so-la-ti-do scale is the diatonic scale with seven notes per octave. These seven notes are generally what we sing or play, and it is how our music is printed.
These 7 notes are the white piano keys starting at C, but only true if in the key of C Major.
HOWEVER in the scales for other keys, this same diatonic scale includes black keys, like 4 sharps in key of E, or 6 flats in key of Gb. Then this do-re-me-fa-so-la-ti-do scale requires those black keys.
This comes about this way: For one example, a major scale spacing (like C Major) is always defined as W W H W W W H (W=whole step, H=half step) starting on the root key of the scale (same key as name of scale). C to D is whole step, D to E is whole step, but E to F is a half step (no black key here). This is the first W W H in the progression, this is why the white key E is in the C Major scale.
C major (and A minor, because it is something different than W W H W W W H) uses all white keys to achieve this progression. But this major scale progression otherwise needs black keys for any other scale.
For example, if you start at C#, you need 7 sharps (many but not all are black keys) to accomplish the W W H W W W H spacing in the scale called C#. These black keys are all quite important in the key of C#.
So, there is a little more to it than that.