How can I get rid of the wanted tag? When I try and leave the station the security just destroys the ship straight away. I don't have anything in my cargo. Is there a timer before it goes away?
This information is out of date as of version 1.3 of the game.
No, there is no timer. If you are Wanted you will have a bounty on your head. To clear the "wanted" tag you must pay the bounty.
You can do this by docking at any space station and going to Contacts -> Pilot's Federation. If you are currently docked, this is easy. If you are in space then if you will not be allowed to dock with a station that is controlled by the faction that you are wanted with (and they will shoot at you too). In this case you will need to fly to a station belonging to somebody else to pay the fine.
NB Information based on gamma test; may not apply to release version.
As of the 1.3 Power Play update, this has now changed.
There are two types of status illict activities can net you:
A Fine: Ships will not pursue you and will not attack you. You must pay this fine off at a station affiliated with the faction that issued the fine. If you do not pay off the fine, it will eventually turn into a bounty.
A Bounty: You can no longer pay off your bounty. Instead, bounties will simply expire after some time. Currently that seems to range from 12 hours to 1 week.
If you do incur a bounty, you can simply leave that space until the bounty expires. If you choose the stay in the space, you will show up as 'Wanted' and other NPCs and CMDRs will target you for it.
It is also possible to buy a sidewinder and let a npc in the wanted space kill you. This allows them to collect the bounty and you will be able to pay a small insurance fee and respawn without the bounty.
I accidentally shot a 'clean' one during a dog fight at one of the nav beacons. Got a 400cr bounty. Under transactions it said "On H-Jump". So I jumped to another system and the entry was gone from the transactions tab. However, after docking at the next station and going to the Local Security Office under Contacts there was a new entry under 'Legacy Fines' for 400cr from that earlier incident. There you select to pay the bounty that turned into a fine. A bit confusing how they change from bounty to fine.