If somehow you happen to hear someone said that it's fine to connect your MacBook battery to power socket all the time, then it's unlucky that you've got the wrong idea. Plugging your battery all the time will shorten your battery life.
There is an application called Coconut Battery that can help you inspect your battery life.
How is your battery condition?
Fortunately, there is a quick tip that can help you maintain your battery life: by calibrating your battery every month or two.
Update: Thanks to David for additional information.
Source: Apple Support.
Some articles taken from our resource base, tightly related to current article, to empower you with more knowledge on tweaking the most out of your Mac.