Your opponent used the Scholar's Mate. To prevent, f6 or Nf6.
6 Move checkmate help.

Watch out for the e3 pawn. Every time I see this opening, I think of two things: he's moving out his queen and he has an open diagonal for his bishop. (A common checkmating opening). ;) So you can counter this very simply. Your moves were fine, but the sequence was a little off. Move out your Nf6 before the e5 pawn. By moving out your knight, you keep key squares protected (h5 & e4).
His g4 pawn advancement was obviously to pressure your knight. Counter with your pawn to g5 to stop that attempt. (You can defend your pawn later.) Because once you try to run away from an attacker, it'll not only open up key checkmating squares your opponent used here, but you lose tempo by trying to move all over the place from one attacker to the next. Keep in mind: Let your pieces work for you, not the other way around.
Also, one last thing to keep in mind. Defense! Keep your pieces protected. I think you worried too much about the protection of your one knight that cost you to see the real objection of the game. Checkmate the king! Your opponent used scare tactics of your knight to his advantage. Hope this helps! :)

xblack, this is chess, not some fps shooter. Please refrain from insulting those who are new to the game.
As far as this line goes, i prefer to wait until my opponent has brought his queen out, and is thinking he is going to checkmate me next move, before responding with either Nf6, or f6.
In your case, to save the knight on the move that you asked about, i see Nce7 as probably being the best move to make, but your position is critical. White's next move could be e5, attacking the knight with a pawn, but this is countered with Nf4, and you are set at making a comeback from your admittedly not-so-great opening... but at least you still have all your pieces, and you are still playing.
Try not to get into this position, as White can develop his pieces, all the while attacking your knight, and threatening mate, giving him a decisive advantage. I really doubt you'll be hit with the Scholar's Mate again, though. Now that you know what it is, you should be aware of it.
Btw, has anyone else heard it referred to as Blitzkreig, or is that just me?

Hey don't panic! Your not in bad shape. It's a four move checkmate he's attempting, but you slowed it down with your knight.
Now your next move should be to move, Queen's Pawn to Queen three,
then he'll take your knight, then you move your Queen's Bishop to King three-
blocking his bishop. then your own your own.
The best defense against it is 'Pawn' to 'King 4' then queen to King's bishop
three. then knight to king's rook 3. And that will defend against it.
Do not move your kings' knight pawn to knight three- 'If his queen is moved straight out to rook 5'. Or he'll take your Pawn calling check then he'll take your King's rook.
Practice on 'tactics trainer' forget about the timer, when you make a mistake
redo it- And you'll get better and better.
When I can I warm-up with tactics trainer it makes look at the board.
And good luck..

Thanks for the input everyone. I dont think I'll ever be caught with this sequence again. I didn't realize what he was doing at the time and even thought he might not know how to play since I'd never seen an opening like that. I am very inexperienced but it really helps to talk this one through. I've went through the advice and it is very helpful. I've also attemped to try the same tactic he's used on me to someone else and learned how they countered it. (I lost) Thanks for your feedback everyone. Please post any additional thoughts.

Also a comment that someone made about the name of the move. I followed the link above from jdthompson about the "scholar's mate" and it is referred to by different names. Here is what wikipedia said.
"In some areas, including France, Turkey, Germany, and the Netherlands, as well as Spain, Brazil, and Portugal, scholar's mate is known as shepherd's mate. In Italy it is known as barber's mate, in Iran and most of the Arab world as Napoleon's Plan, in Russia as children's mate and in Poland, Denmark, Hungary, Slovenia, and Israel as shoemaker's mate. It has also occasionally been given other names in English-speaking countries, such as schoolboy's mate and Blitzkrieg; German for "lightning war"(Kidder 1960)."

lol you are a noob
...and you're what? a Grandmaster posing as a lower intermediate player?
Nice disguise, I'm convinced.
I need some advice on how I could have prevented first the checkmate and 2nd from losing my knight. What would have been my best move? Also what kind of Begining is he playing? It seemed rather effective against the silcon defense.