If we talk about gcc exten­sions then prob­a­bly we shouldn’t talk about likely/unlikely func­tions. But since they are widely used into the GNU/Linux kernel, they are much more than strictly related.
In the truth, they are not func­tions, but macros. Let see how they’re defined:

#define likely(x)       __builtin_expect(!!(x), 1)
#define unlikely(x)     __builtin_expect(!!(x), 0)

You can see these lines in include/linux/compiler.h into your kernel sources. As you can see, likely and unlikely are just macros, the real gcc exten­sion is __builtin_expect.

Prat­i­cally talk­ing, __builtin_expect is a way to say to gcc that such con­di­tion is easier to happen then another (this is usu­ally called branch pre­dic­tion) and is needed to opti­mize the code (a jump, or better, an IP change­ment, takes a lot of cpu cycles, so if you can, opti­mize it).
With 1 we say that the if branch is more prob­a­ble than the else one. While, on the other side, with 0 we say that the else branch is more prob­a­ble than the if one.
That said, this means that if we know that an if (or an else) is much more prob­a­ble to happen, we should use such macro.

Please note that we’re talk­ing about kernel code that needs to be extremely opti­mized. If you’re writ­ing your own appli­ca­tion you prob­a­bly won’t need to use such exten­sions since rarely you’ll have to do branch pre­dic­tion (better, the com­piler should do this for you).