Prefixes for simple hydrocarbons are determined by the number of carbon atoms in the longest carbon chain. See here for a list of prefixes. Figure 1 shows the general principle of assigning prefixes regardless of the type of bonds involved in the compound.

Butane, C H 3, C H 2, C H 2, C H 3, is an alkane. The prefix in butane is, B, U, T, and it means the molecule has 4 carbon atoms in the longest carbon chain.    Ethene, C H 2, C H 2, is an alkene. The prefix in ethene is, E, T, H, and it means the molecule has 2 carbon atoms in the longest carbon chain.  Propyne, C H, C, C H 3, is an alkyne. The prefix in propyne is, P, R, O, P, and it means the molecule has 3 carbon atoms in the longest carbon chain.

Figure 1. Role of the prefixes in names of hydrocarbons.