[Note: there are, eventually, possible exceptions to almost everything that follows. However, these are the general rules. Some freely-available resources that cover these topics include the Player's Basic Rules at pp.78-81 and the System Reference Document at pp.100-104.]
How do we know when we are able to cast spells at a higher level?
Your number of spells and level (power) of spells available is a feature of your character's level (experience). In the Starter Set the only place you'll find this is in the table on the back of each spellcaster's character sheet. If you use the Basic Rules, SRD, or the Player's Handbook you'll find a table at the beginning of each class's description detailing spell "slots" (number of "charges", if you will) vs. level (power) at each character level (experience).
how many levels does a spell have?
Each spell has a level (power) which is given in its description.
Each time you cast a spell it costs/consumes/expends one spell slot. I think of them as magical "charges," or bullets in your magical gun.
Casting a spell at higher level cost more spell slots?
Casting a spell at a higher level than its level still only costs one slot. But it's a higher level (power) slot that has been expended. You can always do this; sometimes (as detailed in a spell's individual description) it makes the spell have a stronger effect. That is, you can cast Shield or Magic Missile expending a 5th-level slot. Shield works just the same, because there's nothing in Shield's description to say it changes. Magic Missile gets more powerful as you use higher-level (power) slots to cast it.
i have 4 slots and i cast a level 2 spell will i have 3 slots left or 2?
We should be careful about what level (power) your slots are, here. Let's assume you're the elven wizard from the Starter Set, and you're at level (experience) three. This means you have two 2nd-level slots and four 1st-level slots. If you cast a second-level spell then you'll have expended one of your second-level slots. If you cast a first-level spell you can choose whether to have expended one 1st-level or one second-level slot.
A bonus, if you've read this far: you're not alone.