You seem to have confused the concepts of (1) chord, (2) scale, and (3) key. Your teacher gave you the E minor scale because of the E minor key, not because of the E minor chord. :) Confusing? Let's see:
The E minor chord, abbreviated as Em, has three notes: E, G and B.
The "E minor scale"... you probably mean the E natural minor scale. It has the notes E, F#, G, A, B, C and D. There are other minor scales like melodic, harmonic and jazz minor. Scales are just helper grids to help you reason about things.
The key of E minor means that the tonic chord i.e. the home chord is the E minor chord. If a song is said to be "in E minor", it just means that the E note is a central pitch in the song's harmony like the number 0 is a center in mathematics, and around that central E, notes are played so that an E minor chord would feel like a natural ending or resting state of that song. Because the notes of the E natural minor are so widely used in songs in the key of E minor, a key signature of one sharp (F#) is used in songs in the key of E minor (and its relative major key, G major). The E natural minor scale is a default scale in the key of E minor. Deviations from the default scale are marked with accidentals in staff notation. I assume you've seen accidentals and key signatures when playing piano.
Being in the key of E minor doesn't dictate any note or chord anywhere in the song, even though certain chords tend to be used very often. You can have a chord progression like Em - Am - B7 - Em - Dm6 - E7 - Am - F#7 - B7 - Em6, in a song that's in E minor, even though some of those chords contain notes that cannot be found in the E natural minor scale, or even any E minor scale at all.
The E natural minor scale is just a helper grid. Basic safe default pitches that are often used in songs in the key of Em. For technically oriented people, it could be called the factory default setting of notes for a song in E minor. But harmonic progressions can make chromatic alterations, like in the case of the B7 chord, which has a D# note. That means that the D note has to be made sharp, at least for the duration of that chord. In staff notation, this would be marked with an accidental.
But once more. A scale is a pitch grid that helps you locate cultural default expectations and often-used pitches. But a scale doesn't "sound" and it's not a law of nature. If the backing track plays a plain Em chord, you can play a loud and clear C# note over it with your melody instrument, and then the sounding total chord becomes Em6: E, G, B, C#. You changed the harmony. If you keep playing the C# for a long time, then it can even become an expected note. But if you then play a C natural instead, it will change the situation. But these changes or chromatic alterations do not change the key, if they do not change your feeling of what chord is a home chord. As long the E minor chord feels like home, you're in the key of E minor, regardless of what pitches the air is filled with.
In my opinion, to really learn how note combinations interact in harmony, you have to play chords by ear and try to reproduce the chord progressions you hear. For example, if you play a B major chord or a B minor chord in a song that's in the key of E minor, how it changes the feeling. You have to try both alternatives and learn to feel the difference.
The question "what notes fit where" is often answered with rules-of-thumb like "use this scale", for simplicity and to get beginners something to play that sounds sensible and isn't discouraging. I think that's what your teacher did. You're now supposed to just play notes from the scale and listen to what they sound like over different chords, without over-thinking it. Play and listen. Playing and listening is 90% of learning music. You learn by doing, not by thinking. When the time comes, you will encounter more concepts and different things to play and listen to. The more you've played and listened, the more you'll get out of the next lesson.