Vic Mackey is now free and clear of everything. But he has been stuck behind a desk and has lost all his friends and his family. He is sitting at his desk, on the verge of tears until he hears police sirens outside. He then takes his handgun out of the lock box, looks at it for a few seconds then smirks. He stands up, placing the gun in the back of his pants, puts his jacket on and leaves the office. Then the show ends.
Theory One given Vic's nature, knowing he has a penchant for disobeying orders, he probably decided he wasn't going to be bound to the desk and he would go out and catch criminals on his own time. As he was still an ICE officer, he would have the authority to do so. Making himself invaluable to ICE, they would have no choice but to renew his contract after three years.
Theory Two he felt such immense guilt for what he did to Ronnie, in the end after he sacrificed Ronnie to the police to save himself, he was ultimately left with nothing. Therefore he decided to break Ronnie out of jail and help Ronnie flee into Mexico and perhaps join him, as this would void his contract with ICE and his immunity would have been revoked. Another tie-in theory to this is that Vic may have gone out and busted some big-time gang members/drug dealers under the guise of his I.C.E. authority. Then made a deal with them to break Ronnie out of prison for Vic. That way should they succeed or fail, there would be nothing to tie Vic to the crime as he would likely establish an alibi for himself. Thus keeping Vic's immunity intact.
Theory Three while looking at his gun, he was contemplating suicide. Then decided to leave the building and kill himself. This is unlikely, as Vic is a very strong-willed person and never gives up fighting. He isn't the sort to kill himself under any circumstances. Also he probably wouldn't bother to leave the building to do this, he would have just sat back in his chair and blown his head off. Not to mention he didn't leave a note.
Theory Four Vic could have decided to go vigilante and execute criminals in a "Punisher Style". This is unlikely because Vic is a very intelligent man and would know that eventually he would be caught or killed if he took that road. Considering his whole motivation was to stay out of jail, making this even less likely. Not to mention, Vic only killed as a last resort, never simply because they deserved it.
Theory Five After looking at the picture of him and Lem, Vic may have realized that he was all alone so he decided to go find his family at any cost. The finale shows some major similarities to the end of the first season. He sits in his kitchen after learning his family has left him, he breaks down and after several minutes, collects himself. Then he grabs his gun, puts on his jacket and leaves. We are left wondering where he is going. The next season, we assume he went immediately to try and find his family.
Theory Six Vic simply went home, finally defeated.
Note: In a post-finale interview with Alan Sepinwall, series creator Shawn Ryan revealed his own thoughts on what becomes of Vic Mackey:
Do you view what happens to Vic as a fate worse than death?
As a shark and a survivor, no, I think as long as a shark's alive it can find some place to swim to, I think this is a bad situation for him, and I don't think he's gonna enjoy those three years. The tank's very tiny at the moment.
The series ends with Vic alive and relatively free, and while you strongly hint at what's to come for Claudette and Dutch and some of the others, could you ever see yourself revisiting this world in some form a few years down the road?
Possibly. I might be interested in where Vic Mackey is when that three years with ICE is up.