How long does it take to build better diet and exercise routines? Here are science-backed strategies.