If you want the contents of a single directory, an easy method is to change to it first:
cd ~/my/folder
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off ~/my/folder.7z .
What you saw is that * expands to the list of names of files that don't begin with a .. That's the documented behavior, and it's the main reason why files whose name begins with a . are said to be hidden (the other is that ls doesn't show them by default).
There's no really convenient portable way to list all files in a directory. You can use
~/my/folder/..?* ~/my/folder/.[!.]* ~/my/folder/*
but if there is no file matching one of the patterns then the pattern will remain unexpanded. In bash, you can set the dotglob option to avoid treating a leading . specially (. and .. are still excluded from the matches):
shopt -s dotglob
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off ~/my/folder.7z ~/my/folder/*
In ksh, or in bash if you set the extglob option (or in zsh if you set the ksh_glob option), you can write a pattern that matches all files except . and ..:
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off ~/my/folder.7z ~/my/folder/@(..?*|.[!.]*|*)
In zsh, there's a simpler way of saying that . must not be treated specially in a pattern:
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off ~/my/folder.7z ~/my/folder/*(D)