Ripple ledger stores history of ledgers 0 to N or it stores only N?
That's just a matter of definition. You can define the ledger to be just a single state of the network with a single sequence number. Or you can define the ledger to be every past state of the network as well.
Most commonly, we use the term "ledger" to refer to a single state of the network at a single time.
Each Ripple ledger stores every account info or just accounts on which transaction occur recently?
Again, that's just a matter of definition. Most commonly, we use the term "ledger" to refer to all of the state entries (accounts, offers, trust lines, and so on) that were connected at a particular point in time.
The ledger design is passive. That is, a particular entry can be in ledgers 10,000,000 through 20,000,000 without anything special happening to it and without it requiring any processing as it just sits in the ledger and doesn't do anything.
If a new rippled server starts up with no data at all, it will not begin processing until it reaches some point where it knows every single currently valid/reachable ledger entry. That typically takes about two minutes (because the ledger's structure is specifically designed to make this efficient). At that point, it can process transactions and perform normal functions even though it doesn't have any network history. Of course, it can't tell you what happened in the past.