Let's take G minor pentatonic. G minor pentatonic contains the notes G, Bb, C, D and F. If you express those as scalar intervals, you have 1, b3, 4, 5 and b7. If you find every instance of those notes on the fretboard, it looks like this:
If you were playing 'all over the fretboard', in G minor pentatonic, you'd be hitting all these notes. It's this 'map' which you would have to know or 'internalise'. Internalise is a better word, because you're talking about muscle memory, not just knowledge.
The most typical (and totally adequate) way to learn the entire map is to divide it up into 5 sections, sometimes called 'boxes' or 'positions'. Here is the same map of notes divided up into those 5 sections:
However, you can also devise exercises and routines to deliberately speed up the process of merging the patterns. An example would be practicing 'diagonal' patterns, which cut across the fretboard from position to position:
These diagonal patterns are actually extremely usable - but I would still recommend starting with the 'box' patterns.
Or 'horizontal' patterns, which travel up individual strings or pairs of strings (back to G minor):
If you practice the note set for any given scale (whether it's pentatonic or based off the major/minor scales and modes etc) in this way, then you'll be able to play it all over the fretboard.
I've created a course called 'Technical Training' which is free to use and it's found at Technical Training. It is designed for blues guitarists who want to increase proficiency in the minor pentatonic and it has video demos of all the practice exercises etc.
This 5 position system is something you might also come across described as the 'CAGED' system. I would recommend getting it under your fingers practically before getting too stuck into the theory of it.