Motivation is usually a product of mental health. Mental health is a product of a variety of things like work-life-balance, good sleep, healthy diet, physical exercise, and measured progression towards realistic goals. Optimize and improve on those, and you'll have more motivation and mental energy overall.
Since full time work rarely makes good use of focused mental resources, you might be lucky if you have a couple hours in the evening to work on personal projects. For weekends my experience was I needed Saturday to recover - it's hard to focus on a screen and sit in a chair. But by Sunday I can devote focus into personal projects. Still not very many hours to use. It helps to have no social life and family responsibilities, but I'd rather have those than more programming time.
Overall it's hard to have enough motivation and mental energy while working 8 hours a day, but you can optimize for health and get some more utility out of your free time.