The first fret of your B string corresponds to middle C on the piano.

Guitar music is written goofy, though. It's a low instrument, but can also be fairly high; thus, the music is written an octave higher on a staff. That is, if you presented a pianist with guitar sheet music, he would play the music an octave higher than it would sound on the guitar; this is taken into account when you are taught how to read standard notation.

So, if you want your guitar play the same pitch as a piano playing middle C, you play the note I mentioned above. If you want your sheet music to show what a pianist would interpret as middle C on a staff, you would write the note corresponding to the third fret of your A string.

This concept of guitar music being written an octave higher than it is play is a confusing topic. I'll be glad to answer questions.
Under circumstance os guitar, A3 is referred to and read as middle c. But, the real middle c (that is, while reading piano music) is B1.