They get it from mostly the same place the religious get moral values from. They literally learn and make it up as they go along with help from their innate and instinctive understanding and consciousness.
However they generally apply ‘effect on others and themselves’ as a crucial marker in whether something is in fact a matter of morality and either moral or immoral. Unlike the religious ‘amoral’ rules are often ignored.
So an atheist knows it is bad to harm another becasue they themselves would not like to be harmed. In fact a wolf knows in its pack it is wrong to harm becasue it would not wish to be harmed. No wolf to my knowledge has ever read a religious text.
‘Morality’ in the sense of knowing ‘right’ from ‘wrong’ or moral oughts from oughts not is not the sole provenance of humans. Other animals not only display moral values but studies show that they carry with these a form of culture that makes certain actions taboo. Communal animals that disobey the moral values of the group will be expelled or even killed. It’s a good idea therefore to ensure as a communal animal that you operate within the bounderies of the group.