Like most things with guitar, the only real solution is to practice, practice, practice. That said, there are some tips for memorizing which notes occur where that will help with your practicing (most of this post is recycled from one I made on Reddit a while ago).
To find a specific note on the neck that you don't know, you just have to find the nearest note you do know. I've listed the notes on the frets below that I consider easiest to memorize.
Open string notes (low to high):
E A D G B E
Fifth fret notes:
A D G C E A
Seventh fret notes:
B E A D F# B
Twelfth fret notes:
E A D G B E
What makes them easier? Different things. I'll assume you know all the open strings by heart -- If not, start there! Once you have those memorized, the twelfth fret is easy. The open string notes are just an octave higher.
The seventh fret is next easiest. Each note on the seventh is an octave higher than the previous open string. The seventh fret on the fifth (A) string is an octave up from the sixth (E) string. The seventh fret on the fourth (D) string is an octave up from the fifth (A) string... get the idea? For reasons I'll get to later, this doesn't quite work for the second (B) string.
Now, the guitar is normally tuned in perfect fourths. Each string is a fourth higher than the previous. How many semitones are in a fourth? Five. Each fret is one semitone. Moving five semitones (frets) up the neck is the same as moving one string over. So the notes at the fifth fret are just the same as the open-string notes on the next string over. Fifth fret of the sixth string is A, fifth fret of the fifth string is D. Again, this breaks down at the B string.
So what's the problem with the B string? It's only tuned a major third above the previous string. Everything I've already said applies just the same to the B string, but it's shifted up by one fret.
--TANGENT ALERT--
Want to see something that will amaze you? Play an E-major chord. Now play an A-major. Now play a D-major. Each chord has the same interval pattern since they're all major chords. Each chord is also a perfect fourth higher than the last one - each root note is one string over from the previous. Examine the shapes of the chords - each shape only differs by one semitone from the last one - and that moved semitone only occurs on the B string. Each chord is the same shape, it's just been shifted when it crosses over the B string to compensate for the different tuning. If you had a guitar tuned in all fourths, you could play those three chords using the exact same chord shape.
But I digress.
--TANGENT END--
More tips: Learn the notes on the E strings first. Why? Because if you know all the notes on the low E string, you know all the notes on the high string, just two octaves up.
Know how to play an octave from any note. You probably already know it, but the most common octave shape is easy to remember - it's a capital 'L'. Two frets up, two strings over. If you know how to play a note on any of the strings, you can find it an octave up without moving your hand along the neck. This needs to be changed when you cross over the B string, but you can figure that out.
Also worth noting: Every note on the D string is a major ninth (octave + major second) above the same fret on the low-E string. That is, to find any note on the D string, just go down two strings and two frets (an octave) lower.
Hope this is helpful.