You need to add your IP Address to the Network Section of MongoDB Atlas.
IP Address
Go to MongoDB Atlas, in the side menu you'll see Network Access, add your IP and you're good to go.
Network Access