It is highly recommended that you refrigerate your butter as soon as you get it home from the store so you can keep it from going bad for as long as possible. As long as you properly store your butter, it will last for a number of months. By keeping your butter out of the refrigerator, you are running the risk of bacteria forming which can be harmful if ingested.
Each year there are quite a few people who keep their butter out when they bring it home from the store and as a result end up getting good poisoning. In order to avoid this altogether you will need to make a point of refrigerating your butter immediately after you get it home from the store. This way you will be able to keep it from spoiling for as long as five or six months.