Stability of carbonium ions or carbocations is decided by a number of factors like inductive effect, resonance, hyper-conjugation etc. For example, stability of alkyl carbonium ions is mainly determined by inductive effect and hyper-conjugation while that of vinyl, allyl and benzyl carbocations is determined by resonance.
A detailed account of Stability of carbonium ions or carbocations is discussed here-