On the Mac, it's in System Preferences > Network > Wi-Fi.
There's the "Ask to join new networks" checkbox which you might want to un-check. Then under "Advanced > Wi-Fi", you might want to remove your neighbors' networks from the Preferred Networks list, and perhaps un-check "Remember networks this computer has joined", and perhaps check "Require administrator password to: [√] Change networks".
Even if you had never even looked for these settings and thus left them at their defaults, your Mac wouldn't have joined those other networks unless at some point you told it to (either explicitly, or by picking it from the list presented when your normal networks weren't found).
By the way, your network and your neighbors' networks all have unique names, right? It's not like you've all left your networks with default names like "Linksys" or something silly like that, right? If you haven't given your network a unique name, fix that first.