Each transaction has its own capital gain implications.
If you bought 5 litecoin at $100/per and sold 3 of them at $300/per, you've got a $600 capital gain. If you didn't sell for USD but instead traded them for 1,200 Ripple at $0.75/per, you still have a $600 capital gain. Each transaction requires an assessment of gain/loss based on USD value of items at time of transaction.
1031 exchanges allow for deferred capital gains when the gain is used to purchase a property of like-kind, for example, if I sell one of my rental properties and use the proceeds to buy another one, I can defer capital gains tax from the sale. Cryptocurrency counts as property, but under the new tax bill, section 1031 is limited to real estate, so on your 2018 tax return and forward, there is no question that cryptocurrency trades do not qualify. For 2017 and prior, it is debatable, the IRS does not allow gold for silver exchanges, nor are 1031 exchanges allowed for stocks, so I believe they will view cryptocurrency trades the same way. That said, it sounds like some people have been using 1031 exchanges for cryptocurrency trades.
Here's a decent write-up on using 1031 exchange for cryptocurrency. I agree with his assessment, I don't think they'd allow it, but not sure if they're fussing about it either.