Your ship will automatically scan a body you target, but the basic discovery scanner will let you detect bodies within a 500LS radius. When you pop it off near a star, if there are any nearby bodies you'll get the "X number discovered" message. You can then navigate toward them and do a more complete scan.
The "game" aspect of scanning and exploring comes from the limited range. There are often lots of bodies and even companion stars well outside that 500LS radius. You can take a look at the nav screen for clues. If a star is labeled Starname-A, you can bet there's a Starname-B out there somewhere. If you see a planet named Coelrind 1 and Coelrind 3, for example, you know that there's a Coelrind 2 in an orbit somewhere between.
When cruising around well past light speed, keep watch out your windows. If you see bright dots moving against the static background of space, those are planets, or maybe even a companion star! Fly toward them. If you lose them, change course a little, and the parallax effect will make them move again. Get within 500LS of them and let loose with the discovery scanner, and you should see their orbits and get the "X number discovered" message.
Also, keep an eye out for contacts way off in the distance. Your sensors can pick up frame shift signatures hundreds of thousands of light seconds distance. If you spot a cluster of ships together way off in space, you can bet there's a planetary system in that direction. All you have to decide is if it's worth the trouble to fly out there and see.
Of course, the cool thing is the more you scan, the more money and more reputation you earn. I'd say half the money I've taken in has been from exploration so far. You can clear 3-5K in a system easy if you're thorough.
And, of course, you can upgrade your discovery scanner. The more powerful the scanner, the longer the range. The top-shelf model will expose an entire system in one burst.
Finally, you can get the detailed surface scanner and make even more money by doing in-depth scans of the planets you find. It takes a lot more time, but you can rake in the bucks. Just don't go too long before docking and selling because if your ship is destroyed, all your hard earned work goes with it...
Happy exploring!