For your Solo 401(k) you must formally elect to make an employee deferral contribution by Dec. 31.
The actual contribution can be made up until the personal tax-filing deadline (April 15, or October 15 if an extension was filed). Keep in mind this only refers to a Solo 401(k), not a standard employer 401(k) plans which typically need contributions by December 31st.