First, why Ubuntu 12.04? Version 14.04 is available now, and includes a number of improvements.
Second, the answer to your question depends greatly on your boot mode, which you haven't specified. You can identify your Windows boot mode by examining the partition table type -- if your boot disk uses the Master Boot Record (MBR), your computer is booting in BIOS mode; but if it uses the GUID Partition Table (GPT), it's booting in EFI mode. See here for more on identifying your boot mode. Once you've identified the boot mode, your question can be answered:
Most PCs sold prior to Windows 8's release booted in BIOS mode, but some Windows 7 PCs sold after mid-2011 used EFI mode by default, and even a few older computers can be configured to use EFI.
If you're booting in BIOS mode, you'll be limited by MBR's restrictions, which begin with a 4-primary-partition limit. This limit can be gotten around by creating a special type of primary partition, known as an extended partition, which serves as a placeholder for an arbitrary number of logical partitions. Linux doesn't care much about the distinction between primary and logical partitions; you can use either type as you see fit, within the MBR's limits. Those limits become important because many PCs shipped originally with four primary partitions, making it impossible to create new partitions, even after resizing an existing partition. If you run into this problem, you must either delete a partition that's of little value (typically one holding manufacturer-specific tools) or convert one from primary to logical form. The latter task can be done with my FixParts program, which is part of the
gdisk package in Ubuntu. Don't convert the Windows boot partition from primary to logical, though; that will render it unbootable!
Another meaning of "partition type" is a type code, which for MBR is a 1-byte (0-255, or 0x00-0xFF hexadecimal) value that identifies the intended use of a partition. The Ubuntu installer will set the type code appropriately if you create a partition using the Ubuntu installer. If you use some other tool, give the Linux swap space a type code of 0x82 and all Ubuntu system and data partitions a type code of 0x83. There are other type codes for uses like Linux LVM (0x8E), NTFS (0x07), etc.
Note also that you should NEVER use the standard Windows partitioning tools to create partitions. These tools will convert the disk from MBR to Microsoft's proprietary Logical Device Manager (LDM) format if you create a layout with more than four partitions. You can't install Ubuntu directly to an LDM disk, so if you make this mistake, you'll have to convert back with the help of third-party tools.
If you're booting in EFI mode, you'll use GPT, which supports up to 128 partitions by default (and this value can be raised, if necessary). GPT doesn't distinguish between primary, extended, and logical partitions, although some partitioning tools still prompt for primary vs. logical status when you create partitions on GPT disk. (These tools then ignore what you say, since it's meaningless.)
GPT also supports partition type codes, but instead of a single byte, GPT uses a 16-byte Globally Unique Identifier (GUID), which is awkward to display or enter. Thus, partitioning tools generally set the GUID automatically based on your stated use for the partition or use some sort of code. Tools based on libparted (including
parted, GParted, and the Ubuntu installer) do the former, so you shouldn't have to explicitly set a type code. If you use GPT fdisk (
cgdisk), you'd set a type code of 8200 for Linux swap, 8300 for a Linux filesystem, 8E00 for Linux LVM, 0700 for NTFS, and so on.