It all depends on whose law you broke, how serious the crime is and who the fugative pissed off. If it is an Imperial Crime the MOJ will come after you no matter where inside the borders you are and will be able to catch up with you, depending on the speed of your ship, generally within 3 months. Local laws, depending on the crime, and how often you have done similar things, may cause the same problem or no problems at all. Now if you get the Navy/Marines mad at you, well that means you are quite likely to go down in as little as 2 months, within 2 months any planet with a Naval base you might stop at will be looking for you. (And that is if you have a very fast ship, normally quite a bit less.) ANy Starport with a Marine contingent, (IE virtually all Imperial ports) will be looking for you in about the same time the MOJ will be. If you really ticked off the Marines or the Navy you are unlikely to even be able to hide on independent or even enemy worlds outside the Imperium for long.
Your best bet to escape Imperial Justice is to take a quick two or three jumps, and then go to ground, for a few years, while you build a new identity and wait for the heat to die down. Of course most of the planets where you might want to hide will be checked fairly high on the list.
IMTU that boils down to, do not violate the Rules of War, do not frag with the Port Authority, do not get identified as a Pirate. Those will get you into lots of trouble very fast. Less serious infractions, will get you in trouble but not nearly as much.
If you really want to get into major trouble use a Detached Scout Ship, armed with Nukes, to fire on a highport and conduct acts of piracy. Then you have the Port Authority, the MOJ, the Navy and the IISS all looking for you.