As a native speaker (not a teacher) I’d say they are both grammatically correct, but used for different circumstances. “We never have time to ourselves” conveys we never have time alone, private time. “We never have time for ourselves” conveys a lack of ‘me time’: time spent doing things for ourselves and not for others.
An example using the former might be: “Living with three small children in an apartment, we never have time to ourselves,” ie we are never alone. Examples with the second phrase would be: “Our kids have such a social life, we never have time for ourselves.” “We working mothers are so busy, we never have time for ourselves.”