How long should my proposal be?
How complex is the application?
What should it include?
Depends on the app they want you to create.
How do I calculate the costs and time?
How much is your time worth?
Is there any template out there that I can follow?
There is no 'cookie-cutter' for success in any industry, though assuming you're refering to proposals, not really - or at least I wouldn't recommend it.
Now the serious part - you just need to have a sit down and think about what exactly is required of you. Nobody here can answer for your exact situation. If I were putting a typical proposal together for any development work, I would include an overview, then a contents page going into scrutinous detail so any parties involved that sign are left without any doubt or uncertain terms.
Yes, you'll want to include a timeline and costs but I couldn't ever guide you on that - you could be tasked with developing an uncomprehendably complicated app for all I know, and you could be earning $200k in your 'day job', meaning your time is worth no less than that spent elsewhere.