So I am flying from SBA-SFO on United and then SFO to SAL on Avianca. Both flights were booked via United and obviously I will check in with United at SBA. My question is how exactly will I get the boarding pass for the Avianca leg of the trip? Will the United agents at SBA be able to print it directly or will I have to wait until I get to SFO to get the boarding pass from the Avianca desk? Does this affect how my baggage is checked through also or will it be checked through to SAL in SBA?
As Johns-305 notes, it is likely that they can issue you with both boarding passes when you check-in at SBA, and it may be possible for you to get your own boarding passes in advance online.
Some bad news though. You will unfortunately need to exit the secure area and go back through TSA security for this itinerary. Your United flight into SFO will likely arrive in Terminal 3, but the Avianca flight leaves from Boarding Area A of the International Terminal. There is no secure connector for this particular connection. Your bags should be checked through (confirm this when you drop them off in SBA), so you won't need to reclaim and recheck them, but you will need to walk to the international terminal and go through TSA security again.
Most of the Star Alliance partners leave from the G gates, where there is a post-security connector to Terminal 3, but unfortunately you've found one of the exceptions.
First, this isn't something you should worry about. Where you get you boarding passes really doesn't matter.
Since you are ticketed through UA, including the AV flights, and your first flight is operated by UA, you should expect to get both the UA and AV Boarding Pass at SBA. You should also be able to check-in online and use a mobile boarding pass.
If anything happens, just speak to the Agent for the SAL flight and they will reprint one. You will not have to leave the terminal or pass through the TSA queue again at SFO.