After announcing that they'd eventually have some kind of online service and then keeping the details of it quiet for over a year, Nintendo rolled out the Nintendo Switch Online Service yesterday. The long and short of it is this: with the exception of free-to-play games, any title you want to play online with friends will require everyone to have an active membership. But, there are some benefits.
While you now need an active subscription in order to play games like Splatoon 2 or Overcooked! 2 online with friends, the good news is that with that subscription you get Cloud Saves (a feature that comes in handy should your Switch get lost or damaged) and the "Nintendo Entertainment System - Nintendo Switch Online" service. The latter lets you play classic NES titles on your Switch and even supports online co-op play for titles that were originally couch co-op only, like River City Ransom and Double Dragon. There are 20 games available in this service for now, but additional titles will be added. One interesting aspect of this feature is that it will also support screen sharing and online "pass the controller" play, i.e., you and a friend can hop into Super Mario Bros together and watch the other person play when it's their turn, and they'll watch you when it's yours.
The Nintendo Switch Online Service is available now with one month, three month, or one year individual plans for $3.99, $7.99, and $19.99, respectively, or you can get a family plan that supports up to 8 different Nintendo accounts for $34.99 a year. Additional information can be found at the official website.