all the species are stable, if the charge appearing on them are well dispersed...
in case of carbocations, its the positive charge, if the positive charge is well stabilised, then the carbocation will be stable...
now +ve charge can be stablised, if some negative charge is around it.. just like any electron releasing group...this gives the stability of carbocations in the order primary < secondary < tertiary , since the alkyl groups are electron donating in nature, more the no of alkyl groups the more is it stabilised
for carbanions its just the same... here -ve charge is to be stabilised, so any electron attracting group around the atom , will stabilise the charge, hence making the species more stable... this gives the stability of carbanions in the order primary > secondary> tertiary , since the alkyl groups are electron donating in nature, so lesser the no of alkyl groups more is it stabilised
hopefully this helps 