This can be tricky to know because it's not like storage, where you can sort of predict how much you'll store on the laptop and plan accordingly. RAM is the memory your laptop moves files in and out of in real time while you're using them, so having more of it improves game performance, multitasking speed and generally makes everything feel snappier.
In general, I recommend you get a laptop with at least 8MB of RAM if you don't want it to feel sluggish. If you plan to do a lot of multitasking or running demanding apps and games, try for at least 16GB of RAM.
If you plan to play a lot of fast-paced modern games it's not a bad idea to get a laptop with as much RAM as you can afford, as much as 32MB or more.