It is compulsory to have a valid passport to enter Moroccan territory. Whether you need a Visa or not depends on your nationality. Embassies and consulates can guide you before and during your trip.
For all nationalities, the maximum duration of a tourist stay is 90 days. For European citizens as well as Swiss and Canadian citizens, no Visa is necessary. Nationals of other countries will have to apply.
For stays longer than 90 days, a visa will be required. Please consult the nearest Moroccan embassy or consulate.