During synaptic development, proteins aggregate at specialized pre- and postsynaptic structures. Mechanisms that mediate protein clustering at these sites remain unknown. To investigate this process, we analyzed synaptic targeting of a postsynaptic density protein, PSD-95, by expressing green fluorescent protein– (GFP-) tagged PSD-95 in cultured hippocampal neurons. We find that postsynaptic clustering relies on three elements of PSD-95: N-terminal palmitoylation, the first two PDZ domains, and a C-terminal targeting motif. In contrast, disruptions of PDZ3, SH3, or guanylate kinase (GK) domains do not affect synaptic targeting. Palmitoylation is sufficient to target the diffusely expressed SAP-97 to synapses, and palmitoylation cannot be replaced with alternative membrane association motifs, suggesting that a specialized synaptic lipid environment mediates postsynaptic clustering. The requirements for PDZ domains and a C-terminal domain of PSD-95 indicate that protein–protein interactions cooperate with lipid interactions in synaptic targeting.