Its story of passion and despair is based on Dostoevskys own experience as a compulsive gambler--but Dostoevsky was able to break away, whereas Alexei vows to quit as soon as he breaks even--an event, it is clear, that will never happen.
Like so many other characters in Dostoevekys novels, Alexei is trying to break through the wall of the established order and the human condition itself. But instead he is drawn into the roulette wheels vortex.