Module settings can be defined using the UI under Admin > Advanced Tools > Feature Definitions > Settings.
They can also be defined in config files and then visiting the setuip page will create the settings in the database according to the config file specs. Some information about how to do it with config files is in the article Using the Installation System.
Once the settings are created in the db they will show up in the ModuleSettings.aspx page. To retrieve the settings in code you can look at examples in various features by reviewing the source code. You will see that the SiteModule control alredy has the module settings in a hashtable named "Settings", so you can see example code like this:
HideAddThisButton = WebUtils.ParseBoolFromHashtable(
Settings, "BlogHideAddThisButtonSetting", HideAddThisButton);
ExcerptLength = WebUtils.ParseInt32FromHashtable(
Settings, "BlogExcerptLengthSetting", ExcerptLength);
ExcerptSuffix = Settings["BlogExcerptSuffixSetting"].ToString();
In other pages or if not using SiteModule as a base clase you can get them like this:
Hashtable moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
Hope it helps,