To me, there are a couple of main themes in this short story.
The first one is honesty and responsibility. Jimmy Wells was Bob's best friend and obviously cared for him a great deal. But even so, he did not look the other way when he found out that his old friend was a wanted man.
The second one is destiny, or maybe the idea that people go their own ways in life. Two best friends who cared for each other very much came to be on different sides of the law even though they started out from the same place.
I'd say one of those is the main theme.
I believe it would be safe to say that the theme of O. Henry's story "After Twenty Years" is an old one: Crime Does Not Pay. O. Henry contrasts two different characters who have two different philosophies and two different value systems. Bob is greedy and materialistic. He wants to make a lot of money, buy a lot of things, enjoy a life of luxury, and display his success conspicuously. And he doesn't care how he gets the money as long as he gets it. Jimmy is conventional and conservative. He wants a good steady job that is socially useful. He wants a home and a family. Jimmy is probably a staunch Irish-Catholic who takes his wife and children to church every Sunday. The two men's different philosophies take them on different paths until they finally meet again after twenty years. Jimmy has a good steady job that is useful to society. He likes his work and he has security. When he retires he will receive a pension for the rest of his life. Bob, on the other hand, has made a lot of money through crooked means. But he has no home, no family, no security. The money hasn't really done him much good. He has spent some of it on a scarf pin with a big diamond and a pocket watch decorated with small diamonds. It is important to him to have other people look at him, to admire and envy him. But he is always on the run, and it is probably inevitable that he will end up in prison sooner or later. In O. Henry's story Bob discovers that he can't even trust the man he thought was his best friend. Bob has no friends because he never stays in the same place long enough to acquire friends, and also because he is not the kind of man that decent people would want to have as a friend. His flashy lifestyle has made him conspicuous, easy to identify wherever he goes. His career ends up with his being led off to jail. If he has a whole string of crimes charged against him in Chicago and elsewhere in the West, he could be spending a long time in state prisons. Crime really does not pay.
In the story “After Twenty Years” the reader is introduced to the impressive character of the policemen, who loses some of his valor when presented in contrast to the stranger in the door. The stranger has come to re-acquaint with a friend whom he had agreed to meet twenty years into their future. The stranger is proud of his accomplishments and feels successful. He wears diamonds to give the reader a sense of his success. He is egotistical in his own self-identity. When the reader learns that the stranger’s friend is the policeman and the stranger is a crook, the reader must look back at the foreshadowing that took place in the beginning of the story where the policeman was described. It is here that the theme of “What is a true measure of success. Who is the more successfulI, the policeman who walks a daily beat but has little money or the criminal with his physical wealth?
Another theme in the story is about human nature and self-conflicts. The policeman, Jimmy, goes to meet his friend, but soon sees that his friend is wanted for crimes. He is placed in a position where he has to make a moral choice. He must determine whether to greet his friend or to arrest his friend. Imagine the inner conflict that the policeman must have felt when he made the decision to have another person arrest his old friend. Yet, when the reader looks at the character of the policeman as described in the beginning of the story, the reader already sees him of moral character.