As a DM, I like to make it more trouble than it's worth, or have a heck of a lot of fun with it.
Basically, the player has created an item with a PERSONALITY, wants, needs, desires, and frankly, when it comes to this type of magic, the creator doesn't get to completely decide what those are--or you, up to a point, but it's important to remember, once they are created, the player has no control over the weapon other than wielding it. This is kind of akin to having a kid and raising it. You gave it life and taught it consciousness, but it just doesn't do everything you want all the time. The weapon or item is essentially an NPC that will have its own opinions on things.
What this means is that it can stop working.
You create a specific item and you're looking to make it intelligent and what not. The intelligence can come from anywhere, from an errant spirit to the player's own conscience (though they might not be aware of that). So said item might actually pout, and stop working if it doesn't like what the player is doing. Or if it doesn't want to be sold--if a weapon becomes troublesome to the player because they aren't playing their alignment, they haven't switched but are on the edge, the item might actually turn itself "off" or hide abilities to seem less valuable to the person it's being sold to.
The possibilities are endless. Thyzer has already provided you with the rules. If you're a player, how it will work out for you as a player will depend entirely on the good graces of the DM. They may or may not allow it. Once you do get it, they are pretty likely to play the weapon and not let you have control over the personality, but some DMs just don't want the trouble of doing so, and might allow you to run it, but when they do, they generally have very STATIC effects which are allowed from the weapon.
There are also surprise benefits to players when I run sentient weapons. If the player does something that the weapon really likes, I might a give it a little extra boost of power. Or maybe the weapon hates a certain type of enemy. I like to have the maker discover as they go, and not have it readily apparent when it comes to sentient weapon. Because it ain't your standard magic item.
Rules Wise, as stated in Thyzer's answer, this is the DM's call, both on whether it is even allowed and how much resources it takes, and on how it will be run once it is created.