If you're on a UNIX system you can say "man memcpy" (or "man 3 memcpy" if there is a command with the same name) and that will pull up a manual page that mentions which header file the function is in. Once you've used them for a while you get a sense of which headers you should be including for what purposes. You can also access man pages online, as std10093 mentioned, usually just by googling the name of the function or "man memcpy".
Basically there are two parts to any library: header files, which have function prototypes; and actual library files, which contain the code and which you must link to. For example, if I use pthreads, then I might include <pthread.h> and start using the functions; but until I actually linked with libpthread.a (as it's called on Linux; Windows might say pthread.lib) I'd have linker errors because the linker wouldn't know where to find the code for pthread_create(), pthread_attr_init(), etc. There's actually another layer of complexity. Some libraries are linked statically, which means the code is included in your executable, and some are linked dynamically: this means the library is loaded at run-time (more efficient if many programs use the same library). On Windows, DLL files are dynamic libraries, and on Linux I can see pthread being loaded by my hello world program compiled with pthreads:
Code:
$ ldd hello
linux-vdso.so.1 => (0x00007fff20fad000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb39fe38000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb3a01e1000)
$ ldd hellopthread
linux-vdso.so.1 => (0x00007fff831ff000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f207f118000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f207ed91000)
/lib64/ld-linux-x86-64.so.2 (0x00007f207f356000)
$
DLLs perform the same function on Windows.