The difference is just how the device is connected to it's "neighbors" either in layer 2 (the data link layer) or layer 3 (network layer). When you say L2, the default device is a network switch, where connectivity is managed through unique MAC addresses on each switchport and ports of the devices connected to it. Selecting L2 topology will show you VLAN information (VLAN member ports, names, etc.) and direct connections with other devices also monitored in NPM (whose L2 Topology is also enabled )
On the other hand, selecting L3 topology will give you information on routes, basically using IP addresses in forwarding and receiving data. Common devices where you would enable L3 topology are routers, or layer 3 switches for that matter. NPM will provide you routing protocol information and routing tables.
NPM uses CDP, LLDP, CAM and ARP protocols to gather this information: Network topology considerations - SolarWinds Worldwide, LLC. Help and Support
Hope this helps