Being more social by visiting friends, attending parties and going to church may help keep your brain healthy, according to new research.