It really depends on what you're trying to do.
Function components are easy to write, make it impossible to use component state and are automatically optimized (because by not having any state they are pure and therefore will only need re-rendering when their props change).
Class components provide you a few more escape hatches like component state and lifecycle control. They give you access to everything React has to offer at the cost of some syntactic overhead and having to take care of render optimization yourself.
The createClass function is the only way to use mixins in React components (though you can replicate most of the functionality first provided via mixins using higher-order components). They're also probably the easiest way to shoot yourself in the foot (by making your components excessively complex via multiple mixins, and because they automatically bind methods, which may be confusing when used in combination with other components).
In my opinion you should start out with function components. If possible, all your component composition should happen via function components to make it easier to reason about. This strongly plays into the practice of having "dumb components" (pure) and "smart components" (containers). When you need to introduce state, wrap your pure component in a class component that provides the state to the pure component which merely renders that state.
I wouldn't recommend using the createClass function anymore unless you have to work with a code base that heavily relies on mixins that can't be easily replaced with higher-order components.