The Lightning Network is a P2P system for making micropayments of digital currencies such as Bitcoin or Litecoin through a mesh network of bidirectional payment channels without delegating custody of funds or trust to third parties.
Normal use of the Lightning Network consists of opening a payment channel by committing a funding transaction to the relevant blockchain, followed by making any number of Lightning transactions that update the tentative distribution of the channel's funds without broadcasting to the blockchain, followed by closing the payment channel by broadcasting the final version of the transaction to distribute the channel's funds.
The spec for using the Lightning Network relies on Segregated Witness (SegWit), a feature that is not yet enabled for the mainnet (production) Bitcoin blockchain but is already enabled for Litecoin.
The payment channels allow participants to transfer money to each other without having to make all their transactions public on the blockchain. This is done by penalizing uncooperative participants. When opening a channel, participants must commit an amount (in a funding transaction, which is on the blockchain). Time based script extensions like CheckSequenceVerify and CheckLockTimeVerify make the penalties possible.
If we presume a large network of channels on the Bitcoin blockchain, and all Bitcoin users are participating on this graph by having at least one channel open on the Bitcoin blockchain, it is possible to create a near-infinite amount of transactions inside this network. The only transactions that are broadcast on the Bitcoin blockchain prematurely are with uncooperative channel counterparties.
The CheckSequenceVerify (CSV) Bitcoin Improvement Proposal details how Hash Time-Locked Contracts are implemented with CSV and used in Lightning.
If Alice and Bob have a payment channel, both of them also have a "latest" commitment transaction. A commitment transaction divides the funds from the funding transaction according to the correct allocation between Alice and Bob. For example, if Alice owns 1.0 mBTC and Bob owns 1.0 mBTC in the channel, the commitment transactions divide the total channel funds in that way.