The formal way of sitting for both genders is kneeling (seiza). People who are not used to sitting in seiza style, may feel uncomfortable after a few minutes, and their legs may get numb. However, foreigners are not usually expected to be able to sit in seiza style for a long time, and an increasing number of Japanese people themselves aren't able to do so due to a westernized lifestyle.
In casual situations, men usually sit cross-legged, while women sit on their knees laying both legs to one side. The former sitting style is considered exclusively male, while the latter is considered exclusively female.